﻿using Abp.Domain.Repositories;
using Abp.Domain.Services;
using Abp.Extensions;
using Abp.UI;
using AngleSharp;
using AngleSharp.Dom;
using Camc.Quality.Common;
using Camc.Quality.Configuration;
using Camc.Quality.Dto.ProcessesEntityDto;
using Camc.Quality.Dto.TableDto;
using Camc.Quality.Dto.TableDto.BopDto;
using Camc.Quality.Dto.TableOutDto;
using Camc.Quality.Dto.TechniqueEntityDto;
using Camc.Quality.IOperationHistory;
using Camc.Quality.Quality.TransformHtml;
using Camc.Quality.RecordTable.FormBase;
using Camc.Quality.RecordTable.FormClass;
using Camc.Quality.RecordTable.FormEntity;
using Camc.Quality.StoreManagement.StoragePut;
using Camc.Quality.TechDoc;
using HtmlAgilityPack;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

namespace Camc.Quality.Quality
{
    public class ProcessManage : DomainService
    {
        #region
        public readonly IRepository<StoreStockContent, Guid> _storeStockContentRepsitory;
        private readonly IRepository<TableBase, Guid> _tableBaseEntity;
        private readonly IOperationHistoryAppService _iOperationHistoryAppService;
        private readonly IRepository<ProcessesEntity, Guid> _processesEntityRepository;//工序
        private readonly IRepository<WorkStepEntity, Guid> _workStepEntityRepository;//工步
        private readonly IRepository<LoadPieceEntity, Guid> _loadPieceRepository;//装入件明细
        private readonly IRepository<ResourcesEntity, Guid> _resourcesEntityRepository;
        private readonly IRepository<TechniqueEntity, Guid> _techniqueEntityRepository;//工艺文件

        private readonly IRepository<具有证明书的主要零件记录表, Guid> _mainPartsRepository;
        private readonly IRepository<舱口盖开闭记录表, Guid> _hatchRepository;
        private readonly IRepository<通用力矩复校记录表, Guid> _momentRecordRepository;
        private readonly IRepository<力矩记录表, Guid> _momentRepository;
        private readonly IRepository<通用多媒体记录表, Guid> _multiMediaRepository;
        private readonly IRepository<通用总装数据记录表, Guid> _totalDataRepository;
        private readonly IRepository<胶液配比情况记录表, Guid> _liquidRatioRepository;
        private readonly IRepository<质量控制记录表, Guid> _controlrecordRepository;
        private readonly IRepository<进箱舱登记表, Guid> _enterRegisterRepository;
        private readonly IRepository<通用记录表, Guid> _generalRecordsRepository;

        private readonly IRepository<舱口盖开闭测试记录表, Guid> _hatchtestRepository;
        private readonly IRepository<产品接地状态检查记录表, Guid> _productgroundingRepository;
        private readonly IRepository<强制检验点记录表, Guid> _compulsoryinspectionRepository;
        private readonly IRepository<自动关闭口盖检查记录表, Guid> _autocloseRepository;
        private readonly IRepository<伺服机构工艺拉杆长度记录表, Guid> _servomechanismRepository;
        private readonly IRepository<状态检查表, Guid> _statuscheckRepository;
        private readonly IRepository<问题记录表, Guid> _problemrecordRepository;
        private readonly IRepository<爆索尺寸测量记录表, Guid> _detonatingcordRepository;
        private readonly IRepository<整流罩星箭分离弹簧压缩数据记录表, Guid> _fairingstararrowRepository;
        private readonly IRepository<载荷支架组合体形位数据记录表, Guid> _loadbracketRepository;
        private readonly IRepository<设计签署总装数据记录表, Guid> _shejiqianshuzongzhuangshujujilubiaoRepository;

        private readonly IRepository<管路活门气密点检查记录表皂泡法, Guid> _soapbubblemethodRepository;
        private readonly IRepository<管路活门气密点检查记录表氦质谱法, Guid> _heliummassspectrometryRepository;
        private readonly IRepository<除了打保险防松外的总装直属件记录表, Guid> _finalassemblyRepository;
        private readonly IRepository<传感器安装测试记录情况统计记录表, Guid> _sensorinstallationRepository;
        private readonly IRepository<插头状态检查表, Guid> _plugstatusRepository;

        private readonly IRepository<电缆插头防水防热记录表, Guid> _cableRepository;
        private readonly IRepository<电连接器插接记录表, Guid> _connectorRepository;
        private readonly IRepository<波纹管变形记录表, Guid> _rippleRepository;

        private readonly IRepository<VideoEntity, Guid> _videoEntityRepository;//视频
        private readonly IRepository<MakeResourcesEntity, Guid> _makeResourcesEntityRepository;//制造资源

        private readonly IRepository<惯组安装记录表一, Guid> _guanzuanzhuangjilubiao1Repository;
        private readonly IRepository<惯组安装记录表二, Guid> _guanzuanzhuangjilubiao2Repository;
        private readonly IRepository<电缆剥线试验记录表低频, Guid> _dianlanboxianshiyanjilubiaodipinRepository;
        private readonly IRepository<压接实验测量记录表低频, Guid> _yajieshiyanceliangjilubiaodipinRepository;
        private readonly IRepository<电缆剥线试验记录表高频, Guid> _dianlanboxianshiyanjilubiaogaopinRepository;
        private readonly IRepository<仪器接收检查记录表, Guid> _yiqijieshoujianchajilubiaoRepository;
        private readonly IRepository<电缆接收检查记录表, Guid> _dianlanjieshoujianchajilubiaoRepository;
        private readonly IRepository<电缆高度测量记录表, Guid> _dianlangaoduceliangjilubiaoRepository;
        private readonly IRepository<箭地接口保护件检查记录表, Guid> _jiandijiekoubaohujianjianchajilubiaoRepository;
        private readonly IRepository<通用检查记录表, Guid> _tongyongjianchajilubiaoRepository;
        private readonly IRepository<对接面形位记录表, Guid> _duijiemianxingweijilubiaoRepository;
        private readonly IRepository<整流罩锉修记录表, Guid> _zhengliuzhaocuoxiujilubiaoRepository;
        private readonly IRepository<整流罩安装后检查记录表, Guid> _zhengliuzhaoanzhuanghoujianchajilubiaoRepository;

        private readonly IRepository<导管检查记录表, Guid> _daoguanjianchajilubiaoRepository;
        private readonly IRepository<管路上箭前吹除记录表, Guid> _guanlushangjianqianchuichujilubiaoRepository;
        private readonly IRepository<气封管流量测试记录表, Guid> _qifengguanliuliangceshijilubiaoRepository;
        private readonly IRepository<阀门气瓶过滤器流量计输送管金属软管等检查记录表, Guid> _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository;
        private readonly IRepository<波纹管变形记录表, Guid> _bowenguanbianxingjilubiaoRepository;
        private readonly IRepository<单机安装位置记录表, Guid> _danjianzhuangweizhijilubiaoRepository;
        private readonly IRepository<安装距离记录表, Guid> _anzhuangjulijilubiaoRepository;
        private readonly IRepository<小导管卡箍间距测量表, Guid> _xiaodaoguankagujianjuceliangbiaoRepository;
        private readonly IRepository<未按要求施加力矩及未打保险防松记录表, Guid> _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository;
        private readonly IRepository<分解重装记录表, Guid> _fenjiechongzhuangjilubiaoRepository;
        private readonly IRepository<配合七零三绝热记录表, Guid> _peiheqilingsanjuerejilubiaoRepository;
        private readonly IRepository<绝热去除记录表, Guid> _juerequchujilubiaoRepository;
        private readonly IRepository<连续拧紧环节力矩复校记录表, Guid> _lianxuningjinhuanjielijufujiaojilubiaoRepository;
        private readonly IRepository<管路垫块安装情况记录表, Guid> _guanlidiankuaianzhuangqingkuangjilubiaoRepository;
        private readonly IRepository<箭体结构防水记录表, Guid> _jiantijiegoufangshuijilubiaoRepository;
        private readonly IRepository<搭接线安装部位防水记录表, Guid> _dajiexiananzhuangbuweifangshuijilubiaoRepository;
        private readonly IRepository<电缆插头防水防热记录表, Guid> _dianlanchatoufangshuifangrejilubiaoRepository;

        private readonly IRepository<总装零件称重记录表, Guid> _zongzhuanglingjianchengzhongjilubiaoRepository;
        private readonly IRepository<总装耗材称重记录表, Guid> _zongzhuanghaocaichengzhongjilubiaoRepository;
        private readonly IRepository<箭体称重记录表, Guid> _jiantichengzhongjilubiaoRepository;
        private readonly IRepository<箭体称重时多装少装产品记录表, Guid> _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository;
        private readonly IRepository<飞行质量质心设备调平数据记录表, Guid> _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository;
        private readonly IRepository<飞行质量质心皮重及参数记录表, Guid> _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository;
        private readonly IRepository<横向质心测量记录表, Guid> _hengxiangzhixinceliangjilubiaoRepository;
        private readonly IRepository<大部段称重记录表, Guid> _dabuduanchengzhongjilubiaoRepository;

        private readonly IRepository<产品安装确认表, Guid> _chanpinanzhuangquerenbiaoRepository;
        private readonly IRepository<阀门安装状态确认表, Guid> _famenanzhuangzhuangtaiquerenbiaoRepository;

        private readonly IRepository<通用接收检查记录表, Guid> _tongyongjieshoujianchajilubiaoRepository;
        private readonly IRepository<通用保护件检查记录表, Guid> _tongyongbaohujianjianchajilubiaoRepository;
        private readonly IRepository<接口检查记录表, Guid> _jiekoujianchajilubiaoRepository;
        private readonly IRepository<象限标识检查记录表, Guid> _xiangxianbiaoshijianchajilubiaoRepository;
        private readonly IRepository<干燥剂检查记录表, Guid> _ganzaojijianchajilubiaoRepository;
        private readonly IRepository<随大部段交付产品明细表, Guid> _suidabuduanjiaofuchanpinmingxibiaoRepository;

        private readonly IRepository<气瓶组充放气速率记录表, Guid> _qipingzuchongfangqisulvjilubiaoRepository;
        private readonly IRepository<系统保压记录表, Guid> _xitongbaoyajilubiaoRepository;
        private readonly IRepository<气瓶压力测试记录表, Guid> _qipingyaliceshijilubiaoRepository;
        private readonly IRepository<阀门使用次数记录表, Guid> _famenshiyongceshujilubiaoRepository;
        private readonly IRepository<阀门测试记录表一, Guid> _famenceshijilubiaoyiRepository;
        private readonly IRepository<气封流量测试记录表, Guid> _qifengliuliangceshijilubiaoRepository;
        private readonly IRepository<阀门测试记录表二, Guid> _famenceshijilubiaoerRepository;

        private readonly IRepository<电磁阀尾罩检查表, Guid> _diancifaweizhaojianchabiaoRepository;
        private readonly IRepository<传感器变换器对应关系确认记录表, Guid> _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository;
        private readonly IRepository<产品安装数量记录表, Guid> _chanpinanzhuangshuliangjilubiaoRepository;
        private readonly IRepository<电连接器插接记录表, Guid> _dianlianjieqichajiejilubiaoRepository;
        private readonly IRepository<液位传感器尺寸协调记录表, Guid> _yeweichuanganqichicunxietiaojilubiaoRepository;
        private readonly IRepository<密封插头压接多媒体记录表, Guid> _mifengchatouyajieduomeitijilubiaoRepository;
        private readonly IRepository<岗位分工表, Guid> _gangweifengongbiaoRepository;
        private readonly IRepository<低频压接实验测量记录表, Guid> _dipinyajieshiyanceliangjilubiaoRepository;
        private readonly IRepository<高频压接点电阻及抗电强度检查记录表, Guid> _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository;
        private readonly IRepository<高频压接点抗拉强度检查记录表, Guid> _gaopinyajiediankanglaqiangdujianchajilubiaoRepository;


        private readonly IRepository<电连接器插接多媒体记录表, Guid> _dianlianjieqichajieduomeitijilubiaoRepository;
        private readonly IRepository<仪器安装电缆余量多媒体记录表, Guid> _yiqianzhuangdianlanyuliangduomeitijilubiaoRepository;
        private readonly IRepository<仪器安装分离钢索多媒体记录表, Guid> _yiqianzhuangfenligangsuoduomeitijilubiaoRepository;
        private readonly IRepository<仪器安装分离力测试多媒体记录表, Guid> _yiqianzhuangfenliceshiduomeitijilubiaoRepository;
        private readonly IRepository<仪器安装力矩记录表, Guid> _yiqianzhuanglijvjilubiaoRepository;
        private readonly IRepository<仪器插座安装多媒体记录表, Guid> _yiqichazuoanzhuangduomeitijilubiaoRepository;
        #endregion

        public ProcessManage(
            IRepository<StoreStockContent, Guid> storeStockContentRepsitory,
            IRepository<TableBase, Guid> tableBaseEntity,
            IOperationHistoryAppService iOperationHistoryAppService,
            IRepository<ProcessesEntity, Guid> processesEntityRepository,
            IRepository<WorkStepEntity, Guid> workStepEntityRepository,
            IRepository<LoadPieceEntity, Guid> loadPieceRepository,
            IRepository<ResourcesEntity, Guid> resourcesEntityRepository,
            IRepository<TechniqueEntity, Guid> techniqueEntityRepository,

            IRepository<TransducerConverter, Guid> transducerConverteritory,
            IRepository<MakeResourcesEntity, Guid> makeResourcesEntityRepository,
            IRepository<VideoEntity, Guid> videoEntityRepository,


        #region
            IRepository<具有证明书的主要零件记录表, Guid> mainPartsRepository,
            IRepository<舱口盖开闭记录表, Guid> hatchRepository,
            IRepository<通用力矩复校记录表, Guid> momentRecordRepository,
            IRepository<力矩记录表, Guid> momentRepository,
            IRepository<通用多媒体记录表, Guid> multiMediaRepository,
            IRepository<通用总装数据记录表, Guid> totalDataRepository,
            IRepository<胶液配比情况记录表, Guid> liquidRatioRepository,
            IRepository<质量控制记录表, Guid> controlrecordRepository,
            IRepository<进箱舱登记表, Guid> enterRegisterRepository,
            IRepository<通用记录表, Guid> generalRecordsRepository,
            IRepository<舱口盖开闭测试记录表, Guid> hatchtestRepository,
            IRepository<产品接地状态检查记录表, Guid> productgroundingRepository,
            IRepository<强制检验点记录表, Guid> compulsoryinspectionRepository,
            IRepository<自动关闭口盖检查记录表, Guid> autocloseRepository,
            IRepository<伺服机构工艺拉杆长度记录表, Guid> servomechanismRepository,
            IRepository<状态检查表, Guid> statuscheckRepository,
            IRepository<问题记录表, Guid> problemrecordRepository,
            IRepository<爆索尺寸测量记录表, Guid> detonatingcordRepository,
            IRepository<整流罩星箭分离弹簧压缩数据记录表, Guid> fairingstararrowRepository,
            IRepository<载荷支架组合体形位数据记录表, Guid> loadbracketRepository,
            IRepository<管路活门气密点检查记录表皂泡法, Guid> soapbubblemethodRepository,
            IRepository<管路活门气密点检查记录表氦质谱法, Guid> heliummassspectrometryRepository,
            IRepository<除了打保险防松外的总装直属件记录表, Guid> finalassemblyRepository,
            IRepository<传感器安装测试记录情况统计记录表, Guid> sensorinstallationRepository,
            IRepository<插头状态检查表, Guid> plugstatusRepository,
            IRepository<电缆插头防水防热记录表, Guid> cableRepository,
            IRepository<电连接器插接记录表, Guid> connectorRepository,
            IRepository<波纹管变形记录表, Guid> rippleRepository,
            IRepository<惯组安装记录表一, Guid> guanzuanzhuangjilubiao1Repository,
            IRepository<惯组安装记录表二, Guid> guanzuanzhuangjilubiao2Repository,
            IRepository<电缆剥线试验记录表低频, Guid> dianlanboxianshiyanjilubiaodipinRepository,
            IRepository<压接实验测量记录表低频, Guid> yajieshiyanceliangjilubiaodipinRepository,
            IRepository<电缆剥线试验记录表高频, Guid> dianlanboxianshiyanjilubiaogaopinRepository,
            IRepository<仪器接收检查记录表, Guid> yiqijieshoujianchajilubiaoRepository,
            IRepository<电缆接收检查记录表, Guid> dianlanjieshoujianchajilubiaoRepository,
            IRepository<电缆高度测量记录表, Guid> dianlangaoduceliangjilubiaoRepository,
            IRepository<箭地接口保护件检查记录表, Guid> jiandijiekoubaohujianjianchajilubiaoRepository,
            IRepository<通用检查记录表, Guid> tongyongjianchajilubiaoRepository,
            IRepository<对接面形位记录表, Guid> duijiemianxingweijilubiaoRepository,
            IRepository<整流罩锉修记录表, Guid> zhengliuzhaocuoxiujilubiaoRepository,
            IRepository<整流罩安装后检查记录表, Guid> zhengliuzhaoanzhuanghoujianchajilubiaoRepository,
            IRepository<设计签署总装数据记录表, Guid> shejiqianshuzongzhuangshujujilubiaoRepository,

            IRepository<导管检查记录表, Guid> daoguanjianchajilubiaoRepository,
            IRepository<管路上箭前吹除记录表, Guid> guanlushangjianqianchuichujilubiaoRepository,
            IRepository<气封管流量测试记录表, Guid> qifengguanliuliangceshijilubiaoRepository,
            IRepository<阀门气瓶过滤器流量计输送管金属软管等检查记录表, Guid> famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository,
            IRepository<波纹管变形记录表, Guid> bowenguanbianxingjilubiaoRepository,
            IRepository<单机安装位置记录表, Guid> danjianzhuangweizhijilubiaoRepository,
            IRepository<安装距离记录表, Guid> anzhuangjulijilubiaoRepository,
            IRepository<小导管卡箍间距测量表, Guid> xiaodaoguankagujianjuceliangbiaoRepository,
            IRepository<未按要求施加力矩及未打保险防松记录表, Guid> weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository,
            IRepository<分解重装记录表, Guid> fenjiechongzhuangjilubiaoRepository,
            IRepository<配合七零三绝热记录表, Guid> peiheqilingsanjuerejilubiaoRepository,
            IRepository<绝热去除记录表, Guid> juerequchujilubiaoRepository,
            IRepository<连续拧紧环节力矩复校记录表, Guid> lianxuningjinhuanjielijufujiaojilubiaoRepository,
            IRepository<管路垫块安装情况记录表, Guid> guanlidiankuaianzhuangqingkuangjilubiaoRepository,
            IRepository<箭体结构防水记录表, Guid> jiantijiegoufangshuijilubiaoRepository,
            IRepository<搭接线安装部位防水记录表, Guid> dajiexiananzhuangbuweifangshuijilubiaoRepository,
            IRepository<电缆插头防水防热记录表, Guid> dianlanchatoufangshuifangrejilubiaoRepository,

            IRepository<总装零件称重记录表, Guid> zongzhuanglingjianchengzhongjilubiaoRepository,
            IRepository<总装耗材称重记录表, Guid> zongzhuanghaocaichengzhongjilubiaoRepository,
            IRepository<箭体称重记录表, Guid> jiantichengzhongjilubiaoRepository,
            IRepository<箭体称重时多装少装产品记录表, Guid> jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository,
            IRepository<飞行质量质心设备调平数据记录表, Guid> feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository,
            IRepository<飞行质量质心皮重及参数记录表, Guid> feixingzhiliangzhixinpizhongjicanshujilubiaoRepository,
            IRepository<横向质心测量记录表, Guid> hengxiangzhixinceliangjilubiaoRepository,
            IRepository<大部段称重记录表, Guid> dabuduanchengzhongjilubiaoRepository,

            IRepository<产品安装确认表, Guid> chanpinanzhuangquerenbiaoRepository,
            IRepository<阀门安装状态确认表, Guid> famenanzhuangzhuangtaiquerenbiaoRepository,

            IRepository<通用接收检查记录表, Guid> tongyongjieshoujianchajilubiaoRepository,
            IRepository<通用保护件检查记录表, Guid> tongyongbaohujianjianchajilubiaoRepository,
            IRepository<接口检查记录表, Guid> jiekoujianchajilubiaoRepository,
            IRepository<象限标识检查记录表, Guid> xiangxianbiaoshijianchajilubiaoRepository,
            IRepository<干燥剂检查记录表, Guid> ganzaojijianchajilubiaoRepository,
            IRepository<随大部段交付产品明细表, Guid> suidabuduanjiaofuchanpinmingxibiaoRepository,

            IRepository<气瓶组充放气速率记录表, Guid> qipingzuchongfangqisulvjilubiaoRepository,
            IRepository<系统保压记录表, Guid> xitongbaoyajilubiaoRepository,
            IRepository<气瓶压力测试记录表, Guid> qipingyaliceshijilubiaoRepository,
            IRepository<阀门使用次数记录表, Guid> famenshiyongceshujilubiaoRepository,
            IRepository<阀门测试记录表一, Guid> famenceshijilubiaoyiRepository,
            IRepository<气封流量测试记录表, Guid> qifengliuliangceshijilubiaoRepository,
            IRepository<阀门测试记录表二, Guid> famenceshijilubiaoerRepository,

            IRepository<电磁阀尾罩检查表, Guid> diancifaweizhaojianchabiaoRepository,
            IRepository<传感器变换器对应关系确认记录表, Guid> chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository,
            IRepository<产品安装数量记录表, Guid> chanpinanzhuangshuliangjilubiaoRepository,
            IRepository<电连接器插接记录表, Guid> dianlianjieqichajiejilubiaoRepository,
            IRepository<液位传感器尺寸协调记录表, Guid> yeweichuanganqichicunxietiaojilubiaoRepository,
            IRepository<密封插头压接多媒体记录表, Guid> mifengchatouyajieduomeitijilubiaoRepository,
            IRepository<岗位分工表, Guid> gangweifengongbiaoRepository,
            IRepository<低频压接实验测量记录表, Guid> dipinyajieshiyanceliangjilubiaoRepository,
            IRepository<高频压接点电阻及抗电强度检查记录表, Guid> gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository,
            IRepository<高频压接点抗拉强度检查记录表, Guid> gaopinyajiediankanglaqiangdujianchajilubiaoRepository,

            IRepository<电连接器插接多媒体记录表, Guid> dianlianjieqichajieduomeitijilubiaoRepository,
            IRepository<仪器安装电缆余量多媒体记录表, Guid> yiqianzhuangdianlanyuliangduomeitijilubiaoRepository,
            IRepository<仪器安装分离钢索多媒体记录表, Guid> yiqianzhuangfenligangsuoduomeitijilubiaoRepository,
            IRepository<仪器安装分离力测试多媒体记录表, Guid> yiqianzhuangfenliceshiduomeitijilubiaoRepository,
            IRepository<仪器安装力矩记录表, Guid> yiqianzhuanglijvjilubiaoRepository,
            IRepository<仪器插座安装多媒体记录表, Guid> yiqichazuoanzhuangduomeitijilubiaoRepository
        #endregion
            )
        {
            #region
            _tableBaseEntity = tableBaseEntity;
            _iOperationHistoryAppService = iOperationHistoryAppService;
            _processesEntityRepository = processesEntityRepository;
            _workStepEntityRepository = workStepEntityRepository;
            _loadPieceRepository = loadPieceRepository;
            _resourcesEntityRepository = resourcesEntityRepository;
            _techniqueEntityRepository = techniqueEntityRepository;
            _mainPartsRepository = mainPartsRepository;
            _hatchRepository = hatchRepository;
            _momentRecordRepository = momentRecordRepository;
            _momentRepository = momentRepository;
            _multiMediaRepository = multiMediaRepository;
            _totalDataRepository = totalDataRepository;
            _liquidRatioRepository = liquidRatioRepository;
            _controlrecordRepository = controlrecordRepository;
            _enterRegisterRepository = enterRegisterRepository;
            _generalRecordsRepository = generalRecordsRepository;
            _videoEntityRepository = videoEntityRepository;
            _makeResourcesEntityRepository = makeResourcesEntityRepository;
            _hatchtestRepository = hatchtestRepository;
            _productgroundingRepository = productgroundingRepository;
            _compulsoryinspectionRepository = compulsoryinspectionRepository;
            _autocloseRepository = autocloseRepository;
            _servomechanismRepository = servomechanismRepository;
            _statuscheckRepository = statuscheckRepository;
            _problemrecordRepository = problemrecordRepository;
            _detonatingcordRepository = detonatingcordRepository;
            _fairingstararrowRepository = fairingstararrowRepository;
            _loadbracketRepository = loadbracketRepository;
            _soapbubblemethodRepository = soapbubblemethodRepository;
            _heliummassspectrometryRepository = heliummassspectrometryRepository;
            _finalassemblyRepository = finalassemblyRepository;
            _sensorinstallationRepository = sensorinstallationRepository;
            _plugstatusRepository = plugstatusRepository;
            _cableRepository = cableRepository;
            _connectorRepository = connectorRepository;
            _rippleRepository = rippleRepository;
            _guanzuanzhuangjilubiao1Repository = guanzuanzhuangjilubiao1Repository;
            _guanzuanzhuangjilubiao2Repository = guanzuanzhuangjilubiao2Repository;
            _dianlanboxianshiyanjilubiaodipinRepository = dianlanboxianshiyanjilubiaodipinRepository;
            _yajieshiyanceliangjilubiaodipinRepository = yajieshiyanceliangjilubiaodipinRepository;
            _dianlanboxianshiyanjilubiaogaopinRepository = dianlanboxianshiyanjilubiaogaopinRepository;
            _yiqijieshoujianchajilubiaoRepository = yiqijieshoujianchajilubiaoRepository;
            _dianlanjieshoujianchajilubiaoRepository = dianlanjieshoujianchajilubiaoRepository;
            _dianlangaoduceliangjilubiaoRepository = dianlangaoduceliangjilubiaoRepository;
            _jiandijiekoubaohujianjianchajilubiaoRepository = jiandijiekoubaohujianjianchajilubiaoRepository;
            _tongyongjianchajilubiaoRepository = tongyongjianchajilubiaoRepository;
            _duijiemianxingweijilubiaoRepository = duijiemianxingweijilubiaoRepository;
            _zhengliuzhaocuoxiujilubiaoRepository = zhengliuzhaocuoxiujilubiaoRepository;
            _zhengliuzhaoanzhuanghoujianchajilubiaoRepository = zhengliuzhaoanzhuanghoujianchajilubiaoRepository;
            _shejiqianshuzongzhuangshujujilubiaoRepository = shejiqianshuzongzhuangshujujilubiaoRepository;

            _daoguanjianchajilubiaoRepository = daoguanjianchajilubiaoRepository;
            _guanlushangjianqianchuichujilubiaoRepository = guanlushangjianqianchuichujilubiaoRepository;
            _qifengguanliuliangceshijilubiaoRepository = qifengguanliuliangceshijilubiaoRepository;
            _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository = famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository;
            _bowenguanbianxingjilubiaoRepository = bowenguanbianxingjilubiaoRepository;
            _danjianzhuangweizhijilubiaoRepository = danjianzhuangweizhijilubiaoRepository;
            _anzhuangjulijilubiaoRepository = anzhuangjulijilubiaoRepository;
            _xiaodaoguankagujianjuceliangbiaoRepository = xiaodaoguankagujianjuceliangbiaoRepository;
            _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository = weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository;
            _fenjiechongzhuangjilubiaoRepository = fenjiechongzhuangjilubiaoRepository;
            _peiheqilingsanjuerejilubiaoRepository = peiheqilingsanjuerejilubiaoRepository;
            _juerequchujilubiaoRepository = juerequchujilubiaoRepository;
            _lianxuningjinhuanjielijufujiaojilubiaoRepository = lianxuningjinhuanjielijufujiaojilubiaoRepository;
            _guanlidiankuaianzhuangqingkuangjilubiaoRepository = guanlidiankuaianzhuangqingkuangjilubiaoRepository;
            _jiantijiegoufangshuijilubiaoRepository = jiantijiegoufangshuijilubiaoRepository;
            _dajiexiananzhuangbuweifangshuijilubiaoRepository = dajiexiananzhuangbuweifangshuijilubiaoRepository;
            _dianlanchatoufangshuifangrejilubiaoRepository = dianlanchatoufangshuifangrejilubiaoRepository;

            _zongzhuanglingjianchengzhongjilubiaoRepository = zongzhuanglingjianchengzhongjilubiaoRepository;
            _zongzhuanghaocaichengzhongjilubiaoRepository = zongzhuanghaocaichengzhongjilubiaoRepository;
            _jiantichengzhongjilubiaoRepository = jiantichengzhongjilubiaoRepository;
            _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository = jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository;
            _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository = feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository;
            _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository = feixingzhiliangzhixinpizhongjicanshujilubiaoRepository;
            _hengxiangzhixinceliangjilubiaoRepository = hengxiangzhixinceliangjilubiaoRepository;
            _dabuduanchengzhongjilubiaoRepository = dabuduanchengzhongjilubiaoRepository;

            _chanpinanzhuangquerenbiaoRepository = chanpinanzhuangquerenbiaoRepository;
            _famenanzhuangzhuangtaiquerenbiaoRepository = famenanzhuangzhuangtaiquerenbiaoRepository;

            _tongyongjieshoujianchajilubiaoRepository = tongyongjieshoujianchajilubiaoRepository;
            _tongyongbaohujianjianchajilubiaoRepository = tongyongbaohujianjianchajilubiaoRepository;
            _jiekoujianchajilubiaoRepository = jiekoujianchajilubiaoRepository;
            _xiangxianbiaoshijianchajilubiaoRepository = xiangxianbiaoshijianchajilubiaoRepository;
            _ganzaojijianchajilubiaoRepository = ganzaojijianchajilubiaoRepository;
            _suidabuduanjiaofuchanpinmingxibiaoRepository = suidabuduanjiaofuchanpinmingxibiaoRepository;

            _qipingzuchongfangqisulvjilubiaoRepository = qipingzuchongfangqisulvjilubiaoRepository;
            _xitongbaoyajilubiaoRepository = xitongbaoyajilubiaoRepository;
            _qipingyaliceshijilubiaoRepository = qipingyaliceshijilubiaoRepository;
            _famenshiyongceshujilubiaoRepository = famenshiyongceshujilubiaoRepository;
            _famenceshijilubiaoyiRepository = famenceshijilubiaoyiRepository;
            _qifengliuliangceshijilubiaoRepository = qifengliuliangceshijilubiaoRepository;
            _famenceshijilubiaoerRepository = famenceshijilubiaoerRepository;

            _diancifaweizhaojianchabiaoRepository = diancifaweizhaojianchabiaoRepository;
            _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository = chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository;
            _chanpinanzhuangshuliangjilubiaoRepository = chanpinanzhuangshuliangjilubiaoRepository;
            _dianlianjieqichajiejilubiaoRepository = dianlianjieqichajiejilubiaoRepository;
            _yeweichuanganqichicunxietiaojilubiaoRepository = yeweichuanganqichicunxietiaojilubiaoRepository;
            _mifengchatouyajieduomeitijilubiaoRepository = mifengchatouyajieduomeitijilubiaoRepository;
            _gangweifengongbiaoRepository = gangweifengongbiaoRepository;
            _dipinyajieshiyanceliangjilubiaoRepository = dipinyajieshiyanceliangjilubiaoRepository;
            _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository = gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository;
            _gaopinyajiediankanglaqiangdujianchajilubiaoRepository = gaopinyajiediankanglaqiangdujianchajilubiaoRepository;

            _dianlianjieqichajieduomeitijilubiaoRepository = dianlianjieqichajieduomeitijilubiaoRepository;
            _yiqianzhuangdianlanyuliangduomeitijilubiaoRepository = yiqianzhuangdianlanyuliangduomeitijilubiaoRepository;
            _yiqianzhuangfenligangsuoduomeitijilubiaoRepository = yiqianzhuangfenligangsuoduomeitijilubiaoRepository;
            _yiqianzhuangfenliceshiduomeitijilubiaoRepository = yiqianzhuangfenliceshiduomeitijilubiaoRepository;
            _yiqianzhuanglijvjilubiaoRepository = yiqianzhuanglijvjilubiaoRepository;
            _yiqichazuoanzhuangduomeitijilubiaoRepository = yiqichazuoanzhuangduomeitijilubiaoRepository;
            #endregion
            _storeStockContentRepsitory = storeStockContentRepsitory;
        }
        public async Task CreateTechInfoFromHtml(Camc.Quality.TechDoc.TechDocDto input, string techniqueName)
        {
            var existstech = await _techniqueEntityRepository.FirstOrDefaultAsync(p => p.TechniqueNumber == input.CodeId);
            if (existstech != null)
            {
                throw new UserFriendlyException("已解析 " + input.CodeId);
            }
            string html = "";
            try
            {
                var req = (HttpWebRequest)WebRequest.Create(input.Url);  //获取网页源代码
                req.Timeout = Timeout.Infinite;
                req.KeepAlive = true;
                var respones = (HttpWebResponse)req.GetResponse();
                html = new StreamReader(respones.GetResponseStream(), Encoding.GetEncoding("utf-8")).ReadToEnd();  //需指定网页的编码方式，如gb2312或 utf-8	

            }
            catch
            {
                throw new UserFriendlyException("无法读取到该路径下的HTML文件");
            }

            var time = DateTime.Now.Ticks;

            var processList = (from p in input.Procs
                               select new ProcessesDto
                               {
                                   Id = Guid.NewGuid(),
                                   TechniqueEntityId = p.TechniqueEntityId,
                                   OriginalProcessesId = p.OriginalProcessesId,
                                   ProcessesExplain = p.ProcessesExplain,
                                   ProcessesSequence = p.ProcessesSequence,
                                   ProcessesName = p.ProcessesName,
                                   ProcessesWorking = p.ProcessesWorking,
                                   ProcessesType = p.ProcessesType,
                                   ProcessesCharacteristic = p.ProcessesCharacteristic,
                                   URL = "http://10.20.254.53:8080/CAPP/ajax/ShowLogContent.ashx?timestamp=" + time + "&UID=" + p.URL.Split('=')[1] + "&Type=Proc&OrderID=" + p.ProcessesSequence
                               }).ToList();


            //if (processList.Count != 0)
            //{
            //    HtmlToDB.ConvertProcessListFromHtml(html, ref processList);
            //}

            //有接口
            TechniqueDto techniqueDto = GetTechniqueData(html);
            techniqueDto.ProcessesListDto = new List<ProcessesDto>();
            var sort = 1;
            var tableClassNameList = TableClassrereFlex.GetTableClassName();
            //var str=ConvertNameAndPinYin(tableClassNameList);
            foreach (var process in processList)
            {
                System.GC.Collect();
                WebRequest req = WebRequest.Create(process.URL);  //获取网页源代码
                System.Net.ServicePointManager.DefaultConnectionLimit = 200;
                req.Timeout = 6000000;
                var t = req.GetResponse().GetResponseStream();
                html = new StreamReader(t, Encoding.GetEncoding("utf-8")).ReadToEnd();
                //html = new StreamReader(req.GetResponse().GetResponseStream(), Encoding.GetEncoding("utf-8")).ReadToEnd();  //需指定网页的编码方式，如gb2312或 utf-8	
                process.F_HtmlContent = html;

                process.ProcessesSequence = sort;
                await CreateFromProcessHtml(process, input, techniqueDto, tableClassNameList, techniqueName);
                //await CreateFromProcessHtml(process, input, techniqueDto, tableClassNameList, techniqueName);
                sort++;
            }
            techniqueDto.OriginalPPSId = input.SysId;
            var techniqueList = ObjectMapper.Map<TechniqueEntity>(techniqueDto);
            await _techniqueEntityRepository.InsertAsync(techniqueList);
        }

        /// <summary>
        /// 通过上传html文件解析
        /// </summary>
        /// <returns></returns>
        public async Task CreateTechInfoFromLocalHtml(string url)
        {
            //   WebRequest req = WebRequest.Create(url);  //获取网页源代码
            //var   html = new StreamReader(req.GetResponse().GetResponseStream(), Encoding.GetEncoding("utf-8")).ReadToEnd();  //需指定网页的编码方式，如gb2312或 utf-8	
            var doc = new HtmlDocument();
            doc.Load(url, Encoding.GetEncoding("gb2312"));//文件路径

            HtmlNode techdataNode = doc.DocumentNode.SelectSingleNode("//div[@id='techdata']/table/tbody");



            HtmlNode nodes = doc.DocumentNode.SelectSingleNode("//div[@id='ShowContent']");

            HtmlNodeCollection CNodes = nodes.ChildNodes;    //所有的子节点
            var sort = 1;
            TechniqueDto techniqueDto = new TechniqueDto();
            //  techniqueDto.ProcessesListDto = new List<ProcessesDto>();
            var processesListDto = new List<ProcessesDto>();
            var tableClassNameList = TableClassrereFlex.GetTableClassName();
            foreach (HtmlNode item in CNodes)
            {
                try
                {
                    if (item.SelectSingleNode("./table[@class='T']/tbody/tr/td/b").InnerText == "工序目录")
                    {

                    }
                    else if (item.SelectSingleNode("./table[@class='T']/tbody/tr/td/b").InnerText == "工艺说明卡片")
                    {
                        techniqueDto = GetTechniqueDataLocal(doc.DocumentNode.OuterHtml); ;
                    }
                    else if (item.SelectSingleNode("./table[@class='T']/tbody/tr/td/b").InnerText == "工艺状态表")
                    {
                        //techniqueDto.TechniqueStatusTable = GetGYZhuangTaiByDiv(item.OuterHtml);
                    }
                    else if (item.SelectSingleNode("./table[@class='T']/tbody/tr/td/b").InnerText.Contains("工序"))
                    {
                        Random rd = new Random();
                        ProcessesDto processes = new ProcessesDto();
                        processes.Id = Guid.NewGuid();
                        //无法获取原ppsid
                        processes.OriginalProcessesId = rd.Next(100000, 999999).ToString();
                        processes.F_HtmlContent = item.OuterHtml;
                        processes.ProcessesSequence = sort;
                        var pname = item.SelectSingleNode("./table[@class='T']/tbody/tr/td").InnerText;
                        if (pname.Contains(":"))
                        {
                            processes.ProcessesName = pname.Split(":").LastOrDefault();
                        }
                        await CreateFromProcessHtmlLocal(processes, new TechDocDto(), techniqueDto, tableClassNameList, techniqueDto.TechniqueNumber, 2);
                        sort++;
                        // processesListDto.Add(processes);
                    }
                    else
                    {
                        sort++;
                    }
                }
                catch (Exception)
                {

                    throw;
                }


            }
            // techniqueDto.ProcessesListDto = processesListDto;
            var techniqueList = ObjectMapper.Map<TechniqueEntity>(techniqueDto);
            _techniqueEntityRepository.InsertAsync(techniqueList);
        }
        /// <summary>
        /// 工艺文件，有接口
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        private static TechniqueDto GetTechniqueData(string html)
        {
            TechniqueDto techniqueDto = new TechniqueDto();//文件
            techniqueDto.Id = Guid.NewGuid();

            //var doc = new HtmlDocument();
            //doc.LoadHtml(html);
            //HtmlNode nodes = doc.DocumentNode.SelectSingleNode("//div[@id='ShowProcessInstDest']/table/tbody/tr");
            //HtmlNodeCollection ProcessInstnodes = nodes.ChildNodes;

            //foreach (var item in ProcessInstnodes)
            //{
            //    if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("编制"))
            //    {
            //        techniqueDto.TechniqueAuthor = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
            //        techniqueDto.TechniqueAuthorTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
            //    }
            //    else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("校对"))
            //    {
            //        techniqueDto.Proofreader = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
            //        techniqueDto.ProofreaderTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
            //    }
            //    else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("审核"))
            //    {
            //        techniqueDto.Reviewer = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
            //        techniqueDto.ReviewerTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
            //    }
            //    else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("标检"))
            //    {
            //        techniqueDto.Inspector = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
            //        techniqueDto.InspectorTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
            //    }
            //    else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("批准"))
            //    {
            //        techniqueDto.Certifier = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
            //        techniqueDto.CertifierTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
            //    }
            //}


            var TechniqueContent = GetTDFromDivByIdAndClass(html, @" class=""FieldDiv""", @" class=""FieldRow""");
            var Technique = GetTDFromDiv(html, @" id='page1'", "");
            //techniqueDto.OriginalPPSId = input.SysId;
            techniqueDto.TechniqueNumber = Technique[1].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.TechniqueName = Technique[2].SYTwy[1].Replace("&nbsp;", "");
            //techniqueDto.TechniqueAuthor = "";
            techniqueDto.CompileTime = Convert.ToDateTime("2021-05-19");
            techniqueDto.SystemCode = Technique[3].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.ProductCode = Technique[4].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.ModuleCode = Technique[5].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.ModuleName = Technique[6].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.StageSign = (StageSigns)Enum.Parse(typeof(StageSigns), Technique[7].SYTwy[1].Replace("&nbsp;", ""));
            techniqueDto.TechniqueType = (TechniqueTypes)Enum.Parse(typeof(TechniqueTypes), Technique[8].SYTwy[1].Replace("&nbsp;", "")); //(TechniqueTypes)Enum.Parse(typeof(TechniqueTypes), input.Phase);
            techniqueDto.TechniqueCharacter = Technique[9].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.Shape = (Shapes)Enum.Parse(typeof(Shapes), Technique[10].SYTwy[1].Replace("&nbsp;", ""));
            techniqueDto.SecretDegree = (SecretDegrees)Enum.Parse(typeof(SecretDegrees), Technique[11].SYTwy[1].Replace("&nbsp;", ""));
            techniqueDto.UseUnit = Technique[12].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.UseTime = Technique[13].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.BasisFile = Technique[14].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.IssueUnit = Technique[15].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.TechniqueExplain = TechniqueContent.Count == 0 ? "" : TechniqueContent[0].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.Remark = Technique[16].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.TechniqueAuthor = Technique[18].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.TechniqueAuthorTime = Technique[19].SYTwy[0].Replace("&nbsp;", "");


            techniqueDto.Proofreader = Technique[21].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.ProofreaderTime = Technique[22].SYTwy[0].Replace("&nbsp;", "");

            techniqueDto.Reviewer = Technique[24].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.ReviewerTime = Technique[25].SYTwy[0].Replace("&nbsp;", "");


            techniqueDto.Inspector = Technique[27].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.InspectorTime = Technique[28].SYTwy[0].Replace("&nbsp;", "");

            techniqueDto.Certifier = Technique[30].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.CertifierTime = Technique[31].SYTwy[0].Replace("&nbsp;", "");
            return techniqueDto;
        }
        private static TechniqueDto GetTechniqueDataLocal(string html)
        {
            //using (var client = new HttpClient())
            //{
            //    var response = client.GetAsync("").Result;
            //    if (!response.IsSuccessStatusCode)
            //    {

            //    }
            //}
            var doc = new HtmlDocument();
            doc.LoadHtml(html);
            HtmlNode nodes = doc.DocumentNode.SelectSingleNode("//div[@id='ShowProcessInstDest']/table/tbody/tr");
            HtmlNodeCollection ProcessInstnodes = nodes.ChildNodes;
            var TechniqueContent = GetTDFromDivByIdAndClass(html, @" class=""FieldDiv""", @" class=""FieldRow""");
            var Technique = GetTDFromDiv(html, @" id=""techdata""", "");

            TechniqueDto techniqueDto = new TechniqueDto();//文件
            techniqueDto.Id = Guid.NewGuid();

            foreach (var item in ProcessInstnodes)
            {
                if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("编制"))
                {
                    techniqueDto.TechniqueAuthor = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
                    techniqueDto.TechniqueAuthorTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
                }
                else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("校对"))
                {
                    techniqueDto.Proofreader = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
                    techniqueDto.ProofreaderTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
                }
                else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("审核"))
                {
                    techniqueDto.Reviewer = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
                    techniqueDto.ReviewerTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
                }
                else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("标检"))
                {
                    techniqueDto.Inspector = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
                    techniqueDto.InspectorTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
                }
                else if (item.SelectSingleNode("./table/tbody/tr[1]/td").InnerText.Contains("批准"))
                {
                    techniqueDto.Certifier = item.SelectSingleNode("./table/tbody/tr[2]/td").InnerText;
                    techniqueDto.CertifierTime = item.SelectSingleNode("./table/tbody/tr[3]/td").InnerText;
                }
            }
            //techniqueDto.OriginalPPSId = input.SysId;
            techniqueDto.TechniqueNumber = Technique[0].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.TechniqueName = Technique[1].SYTwy[1].Replace("&nbsp;", "");
            // techniqueDto.TechniqueAuthor = "董振义";
            techniqueDto.CompileTime = Convert.ToDateTime("2021-05-19");
            techniqueDto.SystemCode = Technique[2].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.ProductCode = Technique[3].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.ModuleCode = Technique[4].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.ModuleName = Technique[5].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.StageSign = (StageSigns)Enum.Parse(typeof(StageSigns), Technique[6].SYTwy[1].Replace("&nbsp;", ""));
            techniqueDto.TechniqueType = (TechniqueTypes)Enum.Parse(typeof(TechniqueTypes), Technique[7].SYTwy[1].Replace("&nbsp;", "")); //(TechniqueTypes)Enum.Parse(typeof(TechniqueTypes), input.Phase);
            techniqueDto.TechniqueCharacter = Technique[8].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.Shape = (Shapes)Enum.Parse(typeof(Shapes), Technique[9].SYTwy[1].Replace("&nbsp;", ""));
            techniqueDto.SecretDegree = (SecretDegrees)Enum.Parse(typeof(SecretDegrees), Technique[10].SYTwy[1].Replace("&nbsp;", ""));
            techniqueDto.UseUnit = Technique[11].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.UseTime = Technique[12].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.BasisFile = Technique[13].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.IssueUnit = Technique[14].SYTwy[1].Replace("&nbsp;", "");
            techniqueDto.TechniqueExplain = TechniqueContent[0].SYTwy[0].Replace("&nbsp;", "");
            techniqueDto.Remark = Technique[15].SYTwy[1].Replace("&nbsp;", "");
            return techniqueDto;
        }
        /// <summary>
        /// 通过HTML创建文件
        /// </summary>
        /// <param name="html">html内容</param>
        /// <param name="sourceProcessId">工序号</param>
        /// <returns></returns>
        public async Task CreateFromProcessHtml(ProcessesDto processContent, Camc.Quality.TechDoc.TechDocDto input, TechniqueDto techniqueDto, List<string> tableClassNameList, string techniqueName)
        {
            var tableHtmlList = new Dictionary<string, string>();
            //工步内容
            var workStepsHtml = HtmlToDB.ConvertHtml(processContent.ProcessesSequence, processContent.F_HtmlContent, techniqueName, tableClassNameList, false, ref tableHtmlList);
            //表内容
            var saveHtml = HtmlToDB.ConvertHtml(processContent.ProcessesSequence, processContent.F_HtmlContent, techniqueName, tableClassNameList, true, ref tableHtmlList);
            await CreateTableInfoFromSaveHtml(saveHtml, tableHtmlList, processContent, techniqueDto, tableClassNameList, workStepsHtml);
        }
        /// <summary>
        /// 通过替换后的HTML创建数据库表
        /// </summary>
        /// <param name="saveHtml">新HTML</param>
        /// <param name="tableHtmlList">表内容</param>
        /// <param name="sourceProcessId">工序号</param>
        /// <returns></returns>

        private async Task CreateTableInfoFromSaveHtml(string saveHtml, Dictionary<string, string> tableHtmlList, ProcessesDto processinfo, TechniqueDto techniqueDto, List<string> tableClassNameList, string workStepsHtml)
        {
            var context = BrowsingContext.New(AngleSharp.Configuration.Default);
            var document = context.OpenAsync(req => req.Content(saveHtml)).Result;
            List<string> pinYinNameList;
            string[] pinYinNames;
            //转成拼音
            ConvertPinYin(tableClassNameList, out pinYinNameList, out pinYinNames);
            List<IElement> tablestepList = new List<IElement>();
            if (pinYinNameList != null || pinYinNameList.Count > 0)
            {
                tablestepList = document.All.Where(m => (m.LocalName == "b" && !m.Id.IsNullOrEmpty()) || m.LocalName.IsIn(pinYinNames)).ToList();
            }
            else
            {
                tablestepList = document.All.Where(m => (m.LocalName == "b")).ToList();
            }

            var processsteplist = new List<WorkStepDto>();//工步
            var transducerConverterlist = new List<List<TransducerConverter>>();//传感器变换器对应关系记录表
            //图
            Dictionary<string, Guid> keyValues = new Dictionary<string, Guid>();
            var stepindex = 1;
            var tableindex = 0;
            foreach (var table in tablestepList)
            {
                switch (table.LocalName)
                {
                    case "b":
                        tableindex = 0;
                        processsteplist.Add(new WorkStepDto
                        {
                            Id = new Guid(table.Id),
                            TechniqueEntityId = techniqueDto.Id,
                            ProcessesEntityId = processinfo.Id,
                            WorkStepSerialName = table.TextContent,
                            WorkStepNumber = stepindex,
                        });
                        stepindex++;
                        break;
                    case "shipin"://视频
                        tableindex++;
                        var videotable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {

                            var videoList = ObjectMapper.Map<List<VideoEntity>>(TableToData.ConvertToVideo(processinfo.Id, videotable.Key, videotable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex));
                            foreach (var item in videoList)
                            {
                                await _videoEntityRepository.InsertAsync(item);
                            }
                        }
                        break;
                    case "zhizaoziyuan"://制造资源
                        tableindex++;
                        var zzresourcestable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var makeResourcesList = ObjectMapper.Map<List<MakeResourcesEntity>>(TableToData.ConvertToZZResources(processinfo.Id, zzresourcestable.Key, zzresourcestable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex));
                            foreach (var item in makeResourcesList)
                            {
                                await _makeResourcesEntityRepository.InsertAsync(item);
                            }
                        }
                        break;
                    case "zhuangrujianmingxi"://装入件明细
                        tableindex++;
                        var loadpiecetable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var loadPieceList = ObjectMapper.Map<List<LoadPieceEntity>>(TableToData.ConvertToLoadPiece(processinfo.Id, loadpiecetable.Key, loadpiecetable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex));
                            foreach (var item in loadPieceList)
                            {
                                await _loadPieceRepository.InsertAsync(item);
                            }
                        }
                        break;
                    case "tubiao"://图
                        var chartimg = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count() == 0)
                        {
                            keyValues.Add(chartimg.Value, processinfo.Id);
                        }
                        else
                        {
                            keyValues.Add(chartimg.Value, processsteplist[processsteplist.Count() - 1].Id);
                        }

                        break;
                    //第一批
                    case "juyouzhengmingshudezhuyaolingjianjilubiao"://具有证明书的主要零件记录表
                        tableindex++;
                        var momentrecordtable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, momentrecordtable.Key, momentrecordtable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                具有证明书的主要零件记录表 record = new 具有证明书的主要零件记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.SecondDrawingNum, item.Certificate);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _mainPartsRepository.InsertAsync(record);
                                //mainPartslist.Add(record);
                            }

                        }
                        break;
                    case "cangkougaikaibijilubiao"://舱口盖开闭记录表
                        tableindex++;
                        var hatchtable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, hatchtable.Key, hatchtable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                舱口盖开闭记录表 record = new 舱口盖开闭记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordItem, item.ToolUsed);

                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _hatchRepository.InsertAsync(record);
                                //hatchlist.Add(record);
                            }
                        }
                        break;
                    case "tongyonglijufujiaojilubiao"://通用力矩复校记录表
                        tableindex++;
                        var tongyonglijufujiaojilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, tongyonglijufujiaojilubiao.Key, tongyonglijufujiaojilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用力矩复校记录表 record = new 通用力矩复校记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);

                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _momentRecordRepository.InsertAsync(record);
                                //momentrecordlist.Add(record);
                            }
                        }
                        break;
                    case "lijujilubiao"://力矩记录表
                        tableindex++;
                        var momenttable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, momenttable.Key, momenttable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                力矩记录表 record = new 力矩记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);

                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _momentRepository.InsertAsync(record);
                                //momentlist.Add(record);
                            }
                        }
                        break;
                    case "tongyongduomeitijilubiao"://通用多媒体记录表
                        tableindex++;
                        var multimediatable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, multimediatable.Key, multimediatable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用多媒体记录表 record = new 通用多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                await _multiMediaRepository.InsertAsync(record);
                                //multimedialist.Add(record);
                            }
                        }
                        break;
                    case "tongyongzongzhuangshujujilubiao"://通用总装数据记录表
                        tableindex++;
                        var totalDatatable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, totalDatatable.Key, totalDatatable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用总装数据记录表 record = new 通用总装数据记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _totalDataRepository.InsertAsync(record);
                                //totalDatalist.Add(record);
                            }
                        }
                        break;
                    case "jiaoyepeibiqingkuangjilubiao"://胶液配比情况记录表
                        tableindex++;
                        var liquidRatiotable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, liquidRatiotable.Key, liquidRatiotable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                胶液配比情况记录表 record = new 胶液配比情况记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement, item.FirstDrawingName);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _liquidRatioRepository.InsertAsync(record);
                                //liquidRatiolist.Add(record);
                            }
                        }
                        break;
                    case "zhiliangkongzhijilubiao"://质量控制记录表
                        tableindex++;
                        var controlrecordtable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, controlrecordtable.Key, controlrecordtable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                质量控制记录表 record = new 质量控制记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _controlrecordRepository.InsertAsync(record);
                                //controlrecordlist.Add(record);
                            }
                        }
                        break;
                    case "jinxiangcangdengjibiao"://进箱舱登记表
                        tableindex++;
                        var enterRegistertable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, enterRegistertable.Key, enterRegistertable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                进箱舱登记表 record = new 进箱舱登记表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.Model, item.FisrtDrawingNum, item.FirstDrawingName);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.Remarks, item.RecordRequire, item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _enterRegisterRepository.InsertAsync(record);
                                //enterRegisterlist.Add(record);
                            }
                        }
                        break;
                    case "tongyongjilubiao"://通用记录表
                        tableindex++;
                        var generalRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, generalRecordstable.Key, generalRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用记录表 record = new 通用记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _generalRecordsRepository.InsertAsync(record);
                                //generalRecordslist.Add(record);
                            }
                        }
                        break;
                    //第二批
                    case "cangkougaikaibiceshijilubiao"://舱口盖开闭测试记录表
                        tableindex++;
                        var hatchRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, hatchRecordstable.Key, hatchRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                舱口盖开闭测试记录表 record = new 舱口盖开闭测试记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.FirstDrawingName);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _hatchtestRepository.InsertAsync(record);
                                //hatchtestlist.Add(record);
                            }
                        }
                        break;
                    case "chanpinjiedezhuangtaijianchajilubiao"://产品接地状态检查记录表
                        tableindex++;
                        var productRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, productRecordstable.Key, productRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                产品接地状态检查记录表 record = new 产品接地状态检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ToolUsed);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _productgroundingRepository.InsertAsync(record);
                                //productgroundinglist.Add(record);
                            }
                        }
                        break;
                    case "jiangzhijianyandianjilubiao"://强制检验点记录表
                        tableindex++;
                        var compulsoryRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, compulsoryRecordstable.Key, compulsoryRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                强制检验点记录表 record = new 强制检验点记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _compulsoryinspectionRepository.InsertAsync(record);
                                //compulsoryinspectionlist.Add(record);
                            }
                        }
                        break;
                    case "zidongguanbikougaijianchajilubiao"://自动关闭口盖检查记录表  

                        tableindex++;
                        var inspectionRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, inspectionRecordstable.Key, inspectionRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                自动关闭口盖检查记录表 record = new 自动关闭口盖检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordItem);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _autocloseRepository.InsertAsync(record);
                                //autocloselist.Add(record);
                            }
                        }
                        break;
                    case "cifujigougongyilaganchangdujilubiao"://伺服机构工艺拉杆长度记录表
                        tableindex++;
                        var lengthRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, lengthRecordstable.Key, lengthRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                伺服机构工艺拉杆长度记录表 record = new 伺服机构工艺拉杆长度记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _servomechanismRepository.InsertAsync(record);
                                //servomechanismlist.Add(record);
                            }
                        }
                        break;
                    case "zhuangtaijianchabiao"://状态检查表
                        tableindex++;
                        var statusRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, statusRecordstable.Key, statusRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                状态检查表 record = new 状态检查表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _statuscheckRepository.InsertAsync(record);
                                //statuschecklist.Add(record);
                            }
                        }
                        break;
                    case "wentijilubiao"://问题记录表
                        tableindex++;
                        var problemRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, problemRecordstable.Key, problemRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                问题记录表 record = new 问题记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.AbnormalRecord);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                await _problemrecordRepository.InsertAsync(record);
                                //problemrecordlist.Add(record);
                            }
                        }
                        break;
                    case "baosuochecunceliangjilubiao"://爆索尺寸测量记录表
                        tableindex++;
                        var detonatingRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, detonatingRecordstable.Key, detonatingRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                爆索尺寸测量记录表 record = new 爆索尺寸测量记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                await _detonatingcordRepository.InsertAsync(record);
                                //detonatingcordlist.Add(record);
                            }
                        }
                        break;
                    case "zhengliuzhaoxingjianfenlidanhuangyasushujujilubiao"://整流罩/星箭分离弹簧压缩数据记录表
                        tableindex++;
                        var explosiveRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, explosiveRecordstable.Key, explosiveRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                整流罩星箭分离弹簧压缩数据记录表 record = new 整流罩星箭分离弹簧压缩数据记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.ProductNum, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _fairingstararrowRepository.InsertAsync(record);
                                //fairingstararrowlist.Add(record);
                            }
                        }
                        break;
                    case "zaihezhijiazugetixingweishujujilubiao"://载荷支架组合体形位数据记录表
                        tableindex++;
                        var loadRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, loadRecordstable.Key, loadRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                载荷支架组合体形位数据记录表 record = new 载荷支架组合体形位数据记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordItem, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _loadbracketRepository.InsertAsync(record);
                                //loadbracketlist.Add(record);
                            }
                        }
                        break;
                    case "shejiqianshuzongzhuangshujujilubiao"://设计签署总装数据记录表
                        tableindex++;
                        var shejiqianshuzongzhuangshujujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, shejiqianshuzongzhuangshujujilubiao.Key, shejiqianshuzongzhuangshujujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                设计签署总装数据记录表 record = new 设计签署总装数据记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _shejiqianshuzongzhuangshujujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    //第三批
                    case "guanluhuomenqimidianjianchajilubiaozaopaofa"://管路活门气密点检查记录表（皂泡法）
                        tableindex++;
                        var soapRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, soapRecordstable.Key, soapRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                管路活门气密点检查记录表皂泡法 record = new 管路活门气密点检查记录表皂泡法(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                await _soapbubblemethodRepository.InsertAsync(record);
                                //soapbubblemethodlist.Add(record);
                            }
                        }
                        break;
                    case "guanluhuomenqimidianjianchajilubiaohaizhipufa"://管路活门气密点检查记录表（氦质谱法）
                        tableindex++;
                        var heliumRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, heliumRecordstable.Key, heliumRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                管路活门气密点检查记录表氦质谱法 record = new 管路活门气密点检查记录表氦质谱法(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity, item.AtmPressure);
                                await _heliummassspectrometryRepository.InsertAsync(record);
                                //heliummassspectrometrylist.Add(record);
                            }
                        }
                        break;
                    case "chuledabaoxianfangsongwaidezongzhuangzhishujianjilubiao"://除了打保险防松外的总装直属件记录表
                        tableindex++;
                        var insuranceRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, insuranceRecordstable.Key, insuranceRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                除了打保险防松外的总装直属件记录表 record = new 除了打保险防松外的总装直属件记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.FisrtDrawingNum, item.SecondDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.DesignerDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _finalassemblyRepository.InsertAsync(record);
                                //finalassemblylist.Add(record);
                            }
                        }
                        break;
                    case "chuanganqianzhuangceshijiluqingkuangtongjijilubiao"://传感器安装测试记录情况统计记录表
                        tableindex++;
                        var sensorRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, sensorRecordstable.Key, sensorRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                传感器安装测试记录情况统计记录表 record = new 传感器安装测试记录情况统计记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductNum, item.ParentProductName, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement, item.RecordItem, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.RecordMainopoint, item.DesignerDemand, item.ProcessorDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _sensorinstallationRepository.InsertAsync(record);
                                //sensorinstallationlist.Add(record);
                            }
                        }
                        break;
                    case "chatouzhuangtaijianchabiao"://插头状态检查表
                        tableindex++;
                        var plugRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, plugRecordstable.Key, plugRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                插头状态检查表 record = new 插头状态检查表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                await _plugstatusRepository.InsertAsync(record);
                            }
                        }
                        break;

                    //仪器电缆安装
                    case "guanzuanzhuangjilubiaoyi"://惯组安装记录表一
                        tableindex++;
                        var guanzuanzhuangjilubiao1 = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, guanzuanzhuangjilubiao1.Key, guanzuanzhuangjilubiao1.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                惯组安装记录表一 record = new 惯组安装记录表一(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _guanzuanzhuangjilubiao1Repository.InsertAsync(record);
                            }
                        }
                        break;
                    case "guanzuanzhuangjilubiaoer"://惯组安装记录表二
                        tableindex++;
                        var guanzuanzhuangjilubiao2 = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, guanzuanzhuangjilubiao2.Key, guanzuanzhuangjilubiao2.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                惯组安装记录表二 record = new 惯组安装记录表二(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordItem, item.ToolUsed);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _guanzuanzhuangjilubiao2Repository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dianlanbaoxianshiyanjilubiaodipin"://电缆剥线试验记录表低频
                        tableindex++;
                        var dianlanboxianshiyanjilubiaodipin = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dianlanboxianshiyanjilubiaodipin.Key, dianlanboxianshiyanjilubiaodipin.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电缆剥线试验记录表低频 record = new 电缆剥线试验记录表低频(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.SecondToolUsed, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                await _dianlanboxianshiyanjilubiaodipinRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yajieshiyanceliangjilubiaodipin"://压接实验测量记录表低频
                        tableindex++;
                        var yajieshiyanceliangjilubiaodipin = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yajieshiyanceliangjilubiaodipin.Key, yajieshiyanceliangjilubiaodipin.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                压接实验测量记录表低频 record = new 压接实验测量记录表低频(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.RecordItem);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                await _yajieshiyanceliangjilubiaodipinRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dianlanbaoxianshiyanjilubiaogaopin"://电缆剥线试验记录表高频
                        tableindex++;
                        var dianlanboxianshiyanjilubiaogaopin = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dianlanboxianshiyanjilubiaogaopin.Key, dianlanboxianshiyanjilubiaogaopin.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电缆剥线试验记录表高频 record = new 电缆剥线试验记录表高频(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.SecondToolUsed, item.RecordItem);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.SecondMeasuredValues, item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                await _dianlanboxianshiyanjilubiaogaopinRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yiqijieshoujianchajilubiao"://仪器接收检查记录表
                        tableindex++;
                        var yiqijieshoujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yiqijieshoujianchajilubiao.Key, yiqijieshoujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                仪器接收检查记录表 record = new 仪器接收检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.SecondConfirmResult, item.ThirdConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                await _yiqijieshoujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dianlanjieshoujianchajilubiao"://电缆接收检查记录表
                        tableindex++;
                        var dianlanjieshoujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dianlanjieshoujianchajilubiao.Key, dianlanjieshoujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电缆接收检查记录表 record = new 电缆接收检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.SecondMeasuredValues, item.SecondConfirmResult, item.ThirdConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                await _dianlanjieshoujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dianlangaoduceliangjilubiao"://电缆高度测量记录表
                        tableindex++;
                        var dianlangaoduceliangjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dianlangaoduceliangjilubiao.Key, dianlangaoduceliangjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电缆高度测量记录表 record = new 电缆高度测量记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                await _dianlangaoduceliangjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    ///装配后工作+总体装配工作
                    case "jiandejiekoubaohujianjianchajilubiao"://箭地接口保护件检查记录表
                        tableindex++;
                        var jiandejiekoubaohujianjianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, jiandejiekoubaohujianjianchajilubiao.Key, jiandejiekoubaohujianjianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                箭地接口保护件检查记录表 record = new 箭地接口保护件检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.RecordRequire);
                                await _jiandijiekoubaohujianjianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "tongyongjianchajilubiao"://通用检查记录表
                        tableindex++;
                        var tongyongjianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, tongyongjianchajilubiao.Key, tongyongjianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用检查记录表 record = new 通用检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                await _tongyongjianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "duijiemianxingweijilubiao"://对接面形位记录表
                        tableindex++;
                        var duijiemianxingweijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, duijiemianxingweijilubiao.Key, duijiemianxingweijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                对接面形位记录表 record = new 对接面形位记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement, item.ToolUsed);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                await _duijiemianxingweijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "zhengliuzhaocuoxiujilubiao"://整流罩锉修记录表
                        tableindex++;
                        var zhengliuzhaocuoxiujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, zhengliuzhaocuoxiujilubiao.Key, zhengliuzhaocuoxiujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                整流罩锉修记录表 record = new 整流罩锉修记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                await _zhengliuzhaocuoxiujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "zhengliuzhaoanzhuanghoujianchajilubiao"://整流罩安装后检查记录表
                        tableindex++;
                        var zhengliuzhaoanzhuanghoujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, zhengliuzhaoanzhuanghoujianchajilubiao.Key, zhengliuzhaoanzhuanghoujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                整流罩安装后检查记录表 record = new 整流罩安装后检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual, item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    ///导管接受检查安装记录  don't have install
                    case "daoguanjianchajilubiao"://导管检查记录表
                        tableindex++;
                        var daoguanjianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, daoguanjianchajilubiao.Key, daoguanjianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                导管检查记录表 record = new 导管检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _daoguanjianchajilubiaoRepository.InsertAsync(record);
                                ///
                            }
                        }
                        break;
                    case "guanlushangjianqianchuichujilubiao"://管路上箭前吹除记录表
                        tableindex++;
                        var guanlushangjianqianchuichujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, guanlushangjianqianchuichujilubiao.Key, guanlushangjianqianchuichujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                管路上箭前吹除记录表 record = new 管路上箭前吹除记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _guanlushangjianqianchuichujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "qifengguanliuliangceshijilubiao"://气封管流量测试记录表
                        tableindex++;
                        var qifengguanliuliangceshijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, qifengguanliuliangceshijilubiao.Key, qifengguanliuliangceshijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                气封管流量测试记录表 record = new 气封管流量测试记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.RecordRequire);
                                await _qifengguanliuliangceshijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiao"://阀门气瓶过滤器流量计输送管金属软管等检查记录表
                        tableindex++;
                        var famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiao.Key, famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                阀门气瓶过滤器流量计输送管金属软管等检查记录表 record = new 阀门气瓶过滤器流量计输送管金属软管等检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "bowenguanbianxingjilubiao"://波纹管变形记录表
                        tableindex++;
                        var rippleRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, rippleRecordstable.Key, rippleRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                波纹管变形记录表 record = new 波纹管变形记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.RecordElement, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _rippleRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "chanjianzhuangweizhijilubiao"://单机安装位置记录表
                        tableindex++;
                        var chanjianzhuangweizhijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, chanjianzhuangweizhijilubiao.Key, chanjianzhuangweizhijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                单机安装位置记录表 record = new 单机安装位置记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _danjianzhuangweizhijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "anzhuangjulijilubiao"://安装距离记录表
                        tableindex++;
                        var anzhuangjulijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, anzhuangjulijilubiao.Key, anzhuangjulijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                安装距离记录表 record = new 安装距离记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordElement, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _anzhuangjulijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "xiaodaoguankagujianjuceliangbiao"://小导管卡箍间距测量表
                        tableindex++;
                        var xiaodaoguankagujianjuceliangbiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, xiaodaoguankagujianjuceliangbiao.Key, xiaodaoguankagujianjuceliangbiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                小导管卡箍间距测量表 record = new 小导管卡箍间距测量表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _xiaodaoguankagujianjuceliangbiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "weianyaoqiushijialijujiweidabaoxianfangsongjilubiao"://未按要求施加力矩及未打保险防松记录表
                        tableindex++;
                        var weianyaoqiushijialijujiweidabaoxianfangsongjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, weianyaoqiushijialijujiweidabaoxianfangsongjilubiao.Key, weianyaoqiushijialijujiweidabaoxianfangsongjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                未按要求施加力矩及未打保险防松记录表 record = new 未按要求施加力矩及未打保险防松记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.ProcessorDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "fenjiechongzhuangjilubiao"://分解重装记录表
                        tableindex++;
                        var fenjiechongzhuangjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, fenjiechongzhuangjilubiao.Key, fenjiechongzhuangjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                分解重装记录表 record = new 分解重装记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _fenjiechongzhuangjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "peigeqilingsanjuerejilubiao"://配合七零三绝热记录表
                        tableindex++;
                        var peiheqilingsanjuerejilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, peiheqilingsanjuerejilubiao.Key, peiheqilingsanjuerejilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                配合七零三绝热记录表 record = new 配合七零三绝热记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ParentProductName);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _peiheqilingsanjuerejilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "juerequchujilubiao"://绝热去除记录表
                        tableindex++;
                        var juerequchujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, juerequchujilubiao.Key, juerequchujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                绝热去除记录表 record = new 绝热去除记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _juerequchujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "lianxuningjinhuanjielijufujiaojilubiao"://连续拧紧环节力矩复校记录表
                        tableindex++;
                        var lianxuningjinhuanjielijufujiaojilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, lianxuningjinhuanjielijufujiaojilubiao.Key, lianxuningjinhuanjielijufujiaojilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                连续拧紧环节力矩复校记录表 record = new 连续拧紧环节力矩复校记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.ProcessorDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _lianxuningjinhuanjielijufujiaojilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "guanludiankuaianzhuangqingkuangjilubiao"://管路垫块安装情况记录表
                        tableindex++;
                        var guanludiankuaianzhuangqingkuangjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, guanludiankuaianzhuangqingkuangjilubiao.Key, guanludiankuaianzhuangqingkuangjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                管路垫块安装情况记录表 record = new 管路垫块安装情况记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _guanlidiankuaianzhuangqingkuangjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "jiantijiegoufangshuijilubiao"://箭体结构防水记录表
                        tableindex++;
                        var jiantijiegoufangshuijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, jiantijiegoufangshuijilubiao.Key, jiantijiegoufangshuijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                箭体结构防水记录表 record = new 箭体结构防水记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductName, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _jiantijiegoufangshuijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dajiexiananzhuangbuweifangshuijilubiao"://搭接线安装部位防水记录表
                        tableindex++;
                        var dajiexiananzhuangbuweifangshuijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dajiexiananzhuangbuweifangshuijilubiao.Key, dajiexiananzhuangbuweifangshuijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                搭接线安装部位防水记录表 record = new 搭接线安装部位防水记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _dajiexiananzhuangbuweifangshuijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dianlanchatoufangshuifangrejilubiao"://电缆插头防水防热记录表
                        tableindex++;
                        var cableRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, cableRecordstable.Key, cableRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电缆插头防水防热记录表 record = new 电缆插头防水防热记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _cableRepository.InsertAsync(record);
                            }
                        }
                        break;
                    //称重类
                    case "zongzhuanglingjianchenchongjilubiao"://总装零件称重记录表
                        tableindex++;
                        var zongzhuanglingjianchenchongjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, zongzhuanglingjianchenchongjilubiao.Key, zongzhuanglingjianchenchongjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                总装零件称重记录表 record = new 总装零件称重记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _zongzhuanglingjianchengzhongjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "zongzhuanghaocaichenchongjilubiao"://总装耗材称重记录表
                        tableindex++;
                        var zongzhuanghaocaichenchongjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, zongzhuanghaocaichenchongjilubiao.Key, zongzhuanghaocaichenchongjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                总装耗材称重记录表 record = new 总装耗材称重记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _zongzhuanghaocaichengzhongjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "jiantichenchongjilubiao"://箭体称重记录表
                        tableindex++;
                        var jiantichenchongjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, jiantichenchongjilubiao.Key, jiantichenchongjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                箭体称重记录表 record = new 箭体称重记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _jiantichengzhongjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "jiantichenchongshiduozhuangshaozhuangchanpinjilubiao"://箭体称重时多装少装产品记录表
                        tableindex++;
                        var jiantichenchongshiduozhuangshaozhuangchanpinjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, jiantichenchongshiduozhuangshaozhuangchanpinjilubiao.Key, jiantichenchongshiduozhuangshaozhuangchanpinjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                箭体称重时多装少装产品记录表 record = new 箭体称重时多装少装产品记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                await _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "feihangzhiliangzhixinshebeidiaopingshujujilubiao"://飞行质量质心设备调平数据记录表
                        tableindex++;
                        var feihangzhiliangzhixinshebeidiaopingshujujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, feihangzhiliangzhixinshebeidiaopingshujujilubiao.Key, feihangzhiliangzhixinshebeidiaopingshujujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                飞行质量质心设备调平数据记录表 record = new 飞行质量质心设备调平数据记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                await _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "feihangzhiliangzhixinpichongjicanshujilubiao"://飞行质量质心皮重及参数记录表
                        tableindex++;
                        var feihangzhiliangzhixinpichongjicanshujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, feihangzhiliangzhixinpichongjicanshujilubiao.Key, feihangzhiliangzhixinpichongjicanshujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                飞行质量质心皮重及参数记录表 record = new 飞行质量质心皮重及参数记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement, item.RecordItem);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                await _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "hengxiangzhixinceliangjilubiao"://横向质心测量记录表
                        tableindex++;
                        var hengxiangzhixinceliangjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, hengxiangzhixinceliangjilubiao.Key, hengxiangzhixinceliangjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                横向质心测量记录表 record = new 横向质心测量记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                await _hengxiangzhixinceliangjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dabuduanchenchongjilubiao"://大部段称重记录表
                        tableindex++;
                        var dabuduanchenchongjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dabuduanchenchongjilubiao.Key, dabuduanchenchongjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                大部段称重记录表 record = new 大部段称重记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed, item.RecordElement);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _dabuduanchengzhongjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    ///极性检查
                    case "chanpinanzhuangquerenbiao"://产品安装确认表
                        tableindex++;
                        var chanpinanzhuangquerenbiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, chanpinanzhuangquerenbiao.Key, chanpinanzhuangquerenbiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                产品安装确认表 record = new 产品安装确认表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                await _chanpinanzhuangquerenbiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "famenanzhuangzhuangtaiquerenbiao"://阀门安装状态确认表
                        tableindex++;
                        var famenanzhuangzhuangtaiquerenbiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, famenanzhuangzhuangtaiquerenbiao.Key, famenanzhuangzhuangtaiquerenbiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                阀门安装状态确认表 record = new 阀门安装状态确认表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                await _famenanzhuangzhuangtaiquerenbiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    //接收检查
                    case "tongyongjieshoujianchajilubiao"://通用接收检查记录表
                        tableindex++;
                        var tongyongjieshoujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, tongyongjieshoujianchajilubiao.Key, tongyongjieshoujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用接收检查记录表 record = new 通用接收检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _tongyongjieshoujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "tongyongbaohujianjianchajilubiao"://通用保护件检查记录表
                        tableindex++;
                        var tongyongbaohujianjianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, tongyongbaohujianjianchajilubiao.Key, tongyongbaohujianjianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                通用保护件检查记录表 record = new 通用保护件检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _tongyongbaohujianjianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "jiekoujianchajilubiao"://接口检查记录表
                        tableindex++;
                        var jiekoujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, jiekoujianchajilubiao.Key, jiekoujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                接口检查记录表 record = new 接口检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _jiekoujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "xiangxianbiaoshijianchajilubiao"://象限标识检查记录表
                        tableindex++;
                        var xiangxianbiaoshijianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, xiangxianbiaoshijianchajilubiao.Key, xiangxianbiaoshijianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                象限标识检查记录表 record = new 象限标识检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                await _xiangxianbiaoshijianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "ganzaojijianchajilubiao"://干燥剂检查记录表
                        tableindex++;
                        var ganzaojijianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, ganzaojijianchajilubiao.Key, ganzaojijianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                干燥剂检查记录表 record = new 干燥剂检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _ganzaojijianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "suidabuduanjiaofuchanpinmingxibiao"://随大部段交付产品明细表
                        tableindex++;
                        var suidabuduanjiaofuchanpinmingxibiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, suidabuduanjiaofuchanpinmingxibiao.Key, suidabuduanjiaofuchanpinmingxibiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                随大部段交付产品明细表 record = new 随大部段交付产品明细表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                await _suidabuduanjiaofuchanpinmingxibiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    //气密
                    case "qipingzuchongfangqisulvjilubiao"://气瓶组充放气速率记录表
                        tableindex++;
                        var qipingzuchongfangqisulvjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, qipingzuchongfangqisulvjilubiao.Key, qipingzuchongfangqisulvjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                气瓶组充放气速率记录表 record = new 气瓶组充放气速率记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _qipingzuchongfangqisulvjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "jitongbaoyajilubiao"://系统保压记录表
                        tableindex++;
                        var xitongbaoyajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, xitongbaoyajilubiao.Key, xitongbaoyajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                系统保压记录表 record = new 系统保压记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.DesignerDemand, item.RecordRequire);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                await _xitongbaoyajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "qipingyaliceshijilubiao"://气瓶压力测试记录表
                        tableindex++;
                        var qipingyaliceshijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, qipingyaliceshijilubiao.Key, qipingyaliceshijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                气瓶压力测试记录表 record = new 气瓶压力测试记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                await _qipingyaliceshijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "famenshiyongcishujilubiao"://阀门使用次数记录表
                        tableindex++;
                        var famenshiyongceshujilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, famenshiyongceshujilubiao.Key, famenshiyongceshujilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                阀门使用次数记录表 record = new 阀门使用次数记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.RecordStatus);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _famenshiyongceshujilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "famenceshijilubiaoyi"://阀门测试记录表一
                        tableindex++;
                        var famenceshijilubiaoyi = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, famenceshijilubiaoyi.Key, famenceshijilubiaoyi.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                阀门测试记录表一 record = new 阀门测试记录表一(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _famenceshijilubiaoyiRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "qifengliuliangceshijilubiao"://气封流量测试记录表
                        tableindex++;
                        var qifengliuliangceshijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, qifengliuliangceshijilubiao.Key, qifengliuliangceshijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                气封流量测试记录表 record = new 气封流量测试记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.ThirdMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _qifengliuliangceshijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "famenceshijilubiaoer"://阀门测试记录表二
                        tableindex++;
                        var famenceshijilubiaoer = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, famenceshijilubiaoer.Key, famenceshijilubiaoer.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                阀门测试记录表二 record = new 阀门测试记录表二(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _famenceshijilubiaoerRepository.InsertAsync(record);
                            }
                        }
                        break;
                    //其他
                    case "diancifaweizhaojianchabiao"://电磁阀尾罩检查表
                        tableindex++;
                        var diancifaweizhaojianchabiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, diancifaweizhaojianchabiao.Key, diancifaweizhaojianchabiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电磁阀尾罩检查表 record = new 电磁阀尾罩检查表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordLocation, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _diancifaweizhaojianchabiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "chuanganqibianhuanqiduiyingguanjiquerenjilubiao"://传感器变换器对应关系确认记录表
                        tableindex++;
                        var chuanganqibianhuanqiduiyingguanxiquerenjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, chuanganqibianhuanqiduiyingguanxiquerenjilubiao.Key, chuanganqibianhuanqiduiyingguanxiquerenjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                传感器变换器对应关系确认记录表 record = new 传感器变换器对应关系确认记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum, item.ParentProductName, item.SecondDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "chanpinanzhuangshuliangjilubiao"://产品安装数量记录表
                        tableindex++;
                        var chanpinanzhuangshuliangjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, chanpinanzhuangshuliangjilubiao.Key, chanpinanzhuangshuliangjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                产品安装数量记录表 record = new 产品安装数量记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _chanpinanzhuangshuliangjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dianlianjieqichajiejilubiao"://电连接器插接记录表
                        tableindex++;
                        var connectorRecordstable = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, connectorRecordstable.Key, connectorRecordstable.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电连接器插接记录表 record = new 电连接器插接记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo, item.SecondPhotoNo, item.ThirdPhotoNo, item.FourthPhotoNo);
                                await _connectorRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yeweichuanganqichecunxiediaojilubiao"://液位传感器尺寸协调记录表
                        tableindex++;
                        var yeweichuanganqichicunxietiaojilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yeweichuanganqichicunxietiaojilubiao.Key, yeweichuanganqichicunxietiaojilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                液位传感器尺寸协调记录表 record = new 液位传感器尺寸协调记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.RecordElement, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _yeweichuanganqichicunxietiaojilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "mifengchatouyajieduomeitijilubiao"://密封插头压接多媒体记录表
                        tableindex++;
                        var mifengchatouyajieduomeitijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, mifengchatouyajieduomeitijilubiao.Key, mifengchatouyajieduomeitijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                密封插头压接多媒体记录表 record = new 密封插头压接多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.Remarks);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _mifengchatouyajieduomeitijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "gangweifengongbiao"://岗位分工表
                        tableindex++;
                        var gangweifengongbiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, gangweifengongbiao.Key, gangweifengongbiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                岗位分工表 record = new 岗位分工表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _gangweifengongbiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "dipinyajieshiyanceliangjilubiao"://低频压接实验测量记录表
                        tableindex++;
                        var dipinyajieshiyanceliangjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dipinyajieshiyanceliangjilubiao.Key, dipinyajieshiyanceliangjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                低频压接实验测量记录表 record = new 低频压接实验测量记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed, item.RecordItem);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _dipinyajieshiyanceliangjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "gaopinyajiediandianzujikangdianjiangdujianchajilubiao"://高频压接点电阻及抗电强度检查记录表
                        tableindex++;
                        var gaopinyajiediandianzujikangdianqiangdujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, gaopinyajiediandianzujikangdianqiangdujianchajilubiao.Key, gaopinyajiediandianzujikangdianqiangdujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                高频压接点电阻及抗电强度检查记录表 record = new 高频压接点电阻及抗电强度检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "gaopinyajiediankanglajiangdujianchajilubiao"://高频压接点抗拉强度检查记录表
                        tableindex++;
                        var gaopinyajiediankanglaqiangdujianchajilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, gaopinyajiediankanglaqiangdujianchajilubiao.Key, gaopinyajiediankanglaqiangdujianchajilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                高频压接点抗拉强度检查记录表 record = new 高频压接点抗拉强度检查记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    //新6表
                    case "dianlianjieqichajieduomeitijilubiao"://电连接器插接多媒体记录表
                        tableindex++;
                        var dianlianjieqichajieduomeitijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, dianlianjieqichajieduomeitijilubiao.Key, dianlianjieqichajieduomeitijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                电连接器插接多媒体记录表 record = new 电连接器插接多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ParamCode);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo, item.SecondPhotoNo, item.ThirdPhotoNo, item.FourthPhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _dianlianjieqichajieduomeitijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yiqianzhuangdianlanyuliangduomeitijilubiao"://仪器安装电缆余量多媒体记录表
                        tableindex++;
                        var yiqianzhuangdianlanyuliangduomeitijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yiqianzhuangdianlanyuliangduomeitijilubiao.Key, yiqianzhuangdianlanyuliangduomeitijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                仪器安装电缆余量多媒体记录表 record = new 仪器安装电缆余量多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ParamCode);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _yiqianzhuangdianlanyuliangduomeitijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yiqianzhuangfenligangsuoduomeitijilubiao"://仪器安装分离钢索多媒体记录表
                        tableindex++;
                        var yiqianzhuangfenligangsuoduomeitijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yiqianzhuangfenligangsuoduomeitijilubiao.Key, yiqianzhuangfenligangsuoduomeitijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                仪器安装分离钢索多媒体记录表 record = new 仪器安装分离钢索多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ParamCode);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _yiqianzhuangfenligangsuoduomeitijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yiqianzhuangfenliliceshiduomeitijilubiao"://仪器安装分离力测试多媒体记录表
                        tableindex++;
                        var yiqianzhuangfenliceshiduomeitijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yiqianzhuangfenliceshiduomeitijilubiao.Key, yiqianzhuangfenliceshiduomeitijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                仪器安装分离力测试多媒体记录表 record = new 仪器安装分离力测试多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ParamCode);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _yiqianzhuangfenliceshiduomeitijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yiqianzhuanglijujilubiao"://仪器安装力矩记录表
                        tableindex++;
                        var yiqianzhuanglijvjilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yiqianzhuanglijvjilubiao.Key, yiqianzhuanglijvjilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                仪器安装力矩记录表 record = new 仪器安装力矩记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ParamCode, item.ToolUsed);
                                record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _yiqianzhuanglijvjilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    case "yiqichazuoanzhuangduomeitijilubiao"://仪器插座安装多媒体记录表
                        tableindex++;
                        var yiqichazuoanzhuangduomeitijilubiao = tableHtmlList.Where(p => p.Key == table.TextContent).FirstOrDefault();
                        if (processsteplist.Count > 0)
                        {
                            var baseList = TableToData.ConvertToBaseRecord(processinfo.Id, yiqichazuoanzhuangduomeitijilubiao.Key, yiqichazuoanzhuangduomeitijilubiao.Value, processsteplist[processsteplist.Count() - 1].Id, tableindex);
                            foreach (var item in baseList)
                            {
                                仪器插座安装多媒体记录表 record = new 仪器插座安装多媒体记录表(item.SerialNum, item.WorkStepEntityId, item.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ParamCode);
                                record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                await _yiqichazuoanzhuangduomeitijilubiaoRepository.InsertAsync(record);
                            }
                        }
                        break;
                    default:
                        break;
                }
            }
            processinfo.TechniqueEntityId = techniqueDto.Id;
            //工序说明
            processinfo.ProcessesExplain = GetGXContentByDiv(saveHtml, @" class=""Field""", tableHtmlList);// @"" + "\"" + int.Parse(processinfo.OriginalProcessesId) + "\"" + "",
                                                                                                           // processinfo.ProcessesExplain = GetGXContent(saveHtml);
                                                                                                           //工步内容
            var GBList = GetGBFromGX(workStepsHtml, @" class=""T processstep""");// @"" + "\"" + int.Parse(processinfo.OriginalProcessesId) + "\"" + "",
            foreach (var p in processsteplist)//工步
            {
                foreach (var item in GBList)
                {
                    if (p.WorkStepSerialName == item.Name)
                    {
                        StringBuilder sb = new StringBuilder();
                        p.WorkStepName = item.Value;
                        sb.Append(item.Content);

                        if (keyValues.Count > 0)
                        {
                            foreach (KeyValuePair<string, Guid> kvp in keyValues)
                            {
                                if (p.Id == kvp.Value)
                                {
                                    sb.Append(kvp.Key);
                                }
                            }
                        }
                        p.WorkStepContent = sb.ToString();
                        var processsentityteplist = ObjectMapper.Map<WorkStepEntity>(p);
                        var workStepCharacteristic = "";

                        if (p.WorkStepName.Contains("gjgx."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "关键工序|";
                        }
                        if (p.WorkStepName.Contains("jj."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "军检|";
                        }
                        if (p.WorkStepName.Contains("sj."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "三检|";
                        }
                        if (p.WorkStepName.Contains("qzjy."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "强制检验|";
                        }
                        if (p.WorkStepName.Contains("yc."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "易错|";
                        }
                        if (p.WorkStepName.Contains("sjfl."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "涉及分离|";
                        }
                        if (p.WorkStepName.Contains("jx."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "极性|";
                        }
                        if (p.WorkStepName.Contains("dd."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "单点|";
                        }
                        if (p.WorkStepName.Contains("ncz."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "难操作|";
                        }
                        if (p.WorkStepName.Contains("dyw."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "多余物防控|";
                        }
                        if (p.WorkStepName.Contains("czyd."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "操作要点|";
                        }
                        if (p.WorkStepName.Contains("cb."))
                        {
                            workStepCharacteristic = workStepCharacteristic + "成败|";
                        }
                        processsentityteplist.WorkStepCharacteristic = workStepCharacteristic;
                        await _workStepEntityRepository.InsertAsync(processsentityteplist);
                    }
                }
            }
            var process = ObjectMapper.Map<ProcessesEntity>(processinfo);
            await _processesEntityRepository.InsertAsync(process);

        }


        private static void ConvertPinYin(List<string> tableClassNameList, out List<string> pinYinNameList, out string[] pinYinNames)
        {
            pinYinNameList = new List<string>();
            foreach (var item in tableClassNameList)
            {
                pinYinNameList.Add(ConvertToPinYin.GetTotalPingYin(item));
            }
            pinYinNames = pinYinNameList.ToArray();
        }
        private static string ConvertNameAndPinYin(List<string> tableClassNameList)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            string str = "";
            foreach (var item in tableClassNameList)
            {
                keyValuePairs.Add(item, ConvertToPinYin.GetTotalPingYin(item));
                str += item + ":" + ConvertToPinYin.GetTotalPingYin(item) + ",\n";
            }
            return str;
        }
        /// <summary>
        /// 插入表的信息
        /// </summary>
        /// <param name="tableModellist">表信息</param>
        //private void CreateTableList(List<TableModel> tableModellist)
        //{

        //    //var tablelist = new List<RecordEntity>();
        //    //var colinfolist = new List<RecordHeader>();
        //    //var celinfolist = new List<RecordBasics>();
        //    //foreach (var tableModel in tableModellist)
        //    //{
        //    //    var table = new RecordEntity()
        //    //    {
        //    //        Id = Guid.NewGuid(),
        //    //        Name = tableModel.DisplayName,
        //    //        WorkStepEntityId = tableModel.StepId
        //    //    };
        //    //    tablelist.Add(table);
        //    //    var colIndex = 0;

        //    //    foreach (var property in tableModel.ColInfos)
        //    //    {
        //    //        property.Id = Guid.NewGuid();
        //    //        colIndex++;
        //    //        colinfolist.Add(property);
        //    //    }

        //    //    var rownum = tableModel.CellInfos.Select(p => int.Parse(p.Row)).Max();
        //    //    for (var i = 1; i <= rownum; i++)
        //    //    {
        //    //        colIndex = 0;
        //    //        foreach (var data in tableModel.CellInfos.Where(p => int.Parse(p.Row) == i))
        //    //        {
        //    //            data.Id = Guid.NewGuid();
        //    //            data.RecordEntityId = table.Id;
        //    //            if (colinfolist.Count > 0)
        //    //                data.RecordHeaderId = colinfolist[colIndex].Id;
        //    //            colinfolist[colIndex].RecordBasicses = new List<RecordBasics>();
        //    //            colinfolist[colIndex].RecordBasicses.Add(data);
        //    //            table.RecordBasicses.Add(data);
        //    //            celinfolist.Add(data);
        //    //            colIndex++;
        //    //        }
        //    //    }
        //    //    foreach (var item in colinfolist)
        //    //    {
        //    //        _recordHeaderRepository.InsertAsync(item);
        //    //    }
        //    //    foreach (var item in celinfolist)
        //    //    {
        //    //        _recordBasicsRepository.InsertAsync(item);
        //    //    }
        //    //    _recordEntityRepository.InsertAsync(table);
        //    //}

        //}

        /// <summary>
        /// 解析div下td内容
        /// </summary>
        /// <param name="regexInfo">解析内容</param>
        /// <param name="classTable">table class或者id</param>
        public static List<SYDetails> GetTDFromDiv(string regexInfo, string classTable, string classtr)
        {

            string sPattern =
            @"(?is)<div[^>]*?" + classTable + "[^>]*?>[\\s\\S]+?</div>";
            Regex regTable = new Regex(sPattern);

            List<SYDetails> lstSTX = new List<SYDetails>();
            var td = new List<string>();
            foreach (Match mTable in regTable.Matches(regexInfo).Cast<Match>())
            {
                var trs = @"<tr" + classtr + ">(.|\\s)*?</tr>";
                Regex regTr = new Regex(trs);
                foreach (Match mTr in regTr.Matches(mTable.Value).Cast<Match>())  //Skip(1跳过tr 标题列
                {
                    //查找每个TD的内容 包含td 后面 class等		
                    var tda = @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                    td = Regex.Matches(mTr.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                    lstSTX.Add(new SYDetails() { SYTwy = td });
                }
            }
            return lstSTX;
        }
        /// <summary>
        /// 根据平衡组解析div嵌套div下td内容 
        /// </summary>
        /// <param name="regexInfo">解析内容</param>
        /// <param name="classTable">table class或者id</param>
        public static List<SYDetails> GetTDFromDivByIdAndClass(string regexInfo, string classTable, string classtr)
        {
            Regex reg = new Regex(@"(?is)<div[^>]*?" + classTable + "[^>]*?>(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\\b).)*)*(?(o)(?!))</div>");
            MatchCollection list = reg.Matches(regexInfo);
            List<SYDetails> lstSTX = new List<SYDetails>();
            if (list.Count > 0)
            {
                var td = new List<string>();


                var trs = @"<tr" + classtr + ">(.|\\s)*?</tr>";
                Regex regTr = new Regex(trs);
                foreach (Match mTr in regTr.Matches(list[0].Value).Cast<Match>())  //Skip(1跳过tr 标题列
                {
                    //查找每个TD的内容 包含td 后面 class等		
                    var tda = @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                    td = Regex.Matches(mTr.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                    lstSTX.Add(new SYDetails() { SYTwy = td });
                }
            }

            return lstSTX;
        }

        /// <summary>
        /// 解析divlist 
        /// </summary>
        /// <param name="regexInfo">解析内容</param>
        /// <param name="classTable">table class或者id</param>
        public static List<Match> GetDivListFromDiv(string regexInfo, string classTable)
        {
            string sPattern =
            @"(?is)<div" + classTable + ">[\\s\\S]+?</div>";
            Regex regTable = new Regex(sPattern);
            var list = regTable.Matches(regexInfo).Cast<Match>().ToList();

            return list;
        }
        /// <summary>
        /// 解析divlist下表名 
        /// </summary>
        /// <param name="regexInfo">解析内容</param>
        /// <param name="classTable">table class或者id</param>
        public static List<string> GetFormNameFromDiv(string regexInfo, string classTable)
        {
            string sPattern =
            @"(?is)<tr" + classTable + ">[\\s\\S]+?</tr>";


            Regex regTr = new Regex(sPattern);
            List<string> lstSTX = new List<string>();

            foreach (Match mTr in regTr.Matches(regexInfo).Cast<Match>())  //Skip(1跳过tr 标题列
            {

                //查找每个TD的内容 包含td 后面 class等		
                var tda = @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                lstSTX = Regex.Matches(mTr.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();

            }
            return lstSTX;
        }

        /// <summary>
        /// 解析divlist表下值
        /// </summary>
        /// <param name="regexInfo">解析内容</param>
        /// <param name="classTable">table class或者id</param>
        public static List<SYDetails> GetFormVauleFromDiv(string regexInfo, string classTable)
        {
            List<SYDetails> lstSTX = new List<SYDetails>();
            var td = new List<string>();
            var trs = @"<tr" + classTable + ">(.|\\s)*?</tr>";
            Regex regTr = new Regex(trs);
            foreach (Match mTr in regTr.Matches(regexInfo).Cast<Match>())  //Skip(1跳过tr 标题列
            {
                //查找每个TD的内容 包含td 后面 class等		
                var tda = @"(?<=<td[^>]*?[^>]*?>)([\s\S]*?)(?=</td>)";
                td = Regex.Matches(mTr.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                lstSTX.Add(new SYDetails() { SYTwy = td });
            }


            return lstSTX;
        }
        /// <summary>
        /// 解析工序说明
        /// </summary>
        /// <param name="regexInfo"></param>
        /// <param name="classTable"></param>
        /// <param name="classtr"></param>
        /// <returns></returns>
        public static string GetGXContentByDiv(string regexInfo, string classtr, Dictionary<string, string> tableHtmlList)//, string classTable
        {
            var content = "";
            //string sPattern =
            //   @"(?is)<DIV\s+id=" + classTable + ">(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\\b).)*)*(?(o)(?!))</div>";
            //Regex regTable = new Regex(sPattern);

            //foreach (Match mTable in regTable.Matches(regexInfo).Cast<Match>())
            //{
            // trs = @"(?<=<table[^>]*?" + classtr + "[^>]*?>)([\\s\\S]+?)(?=</table>)";
            var trs = @"(?is)<table[^>]*?" + classtr + "[^>]*?>(?><table[^>]*>(?<o>)|</table>(?<-o>)|(?:(?!</?table\\b).)*)*(?(o)(?!))</table>";
            Regex regTr = new Regex(trs);
            foreach (Match mTr in regTr.Matches(regexInfo).Cast<Match>())  //Skip(1跳过tr 标题列
            {
                var tra = @"(?<=<tr class=""FieldHead"">)([\s\S]+?)(?=</tr>)";
                //var tds = Regex.Matches(mTr.Value, tra).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                Regex regTd = new Regex(tra);
                foreach (Match mTd in regTd.Matches(mTr.Value).Cast<Match>())
                {
                    var tda = @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                    var sm = Regex.Matches(mTd.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                    if (sm.Count > 0)
                    {
                        var smn = sm[0];
                        if (smn.Contains("说明"))
                        {
                            var aaa = @" class=""FieldRow""";
                            var tra2 = @"(?is)<tr[^>]*?" + aaa + "[^>]*?>(?><tr[^>]*>(?<o>)|</tr>(?<-o>)|(?:(?!</?tr\\b).)*)*(?(o)(?!))</tr>";// @"(?<=<tr class=""FieldRow"">)([\s\S]+?)(?=</tr>)";
                                                                                                                                              //var tra2 = @"(?<=<tr class=""FieldRow"">)([\s\S]+?)(?=</tr>)";
                            Regex regTr2 = new Regex(tra2);
                            foreach (Match mTr2 in regTr2.Matches(mTr.Value).Cast<Match>())  //Skip(1跳过tr 标题列
                            {
                                //查找每个TD的内容 包含td 后面 class等		
                                //var tda2 = @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                                var bbb = @" align=""left""";
                                var tda2 = @"(?is)<td[^>]*?" + bbb + "[^>]*?>(?><td[^>]*>(?<o>)|</td>(?<-o>)|(?:(?!</?td\\b).)*)*(?(o)(?!))</td>";// @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                                var td2 = Regex.Matches(mTr2.Value, tda2).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                                var str = "无";
                                if (td2.Count > 0)
                                {
                                    str = td2[0].Split("<td align=\"left\">").LastOrDefault();
                                    str = str.Substring(0, str.Length - 5);
                                }

                                content = str;
                                break;
                            }
                        }
                        if (smn.Contains("视频"))
                        {
                            content = content + mTr.Value;
                            break;

                        }
                    }
                    if (content != "")
                    {
                        break;
                    }
                }

            }
            //    if (content != "")
            //    {
            //        break;
            //    }
            //}
            // 解析工序下的图片文件
            var doc = new HtmlDocument();
            var t = regexInfo.Split("<table class=\"T processstep\">").FirstOrDefault();
            doc.LoadHtml(t);
            // HtmlNodeCollection


            HtmlNodeCollection gbnode2 = doc.DocumentNode.SelectNodes("//tubiao");

            if (gbnode2 != null)
            {
                //var appsettingsjson = JObject.Parse(File.ReadAllText("appsettings.json"));
                //var app = (JObject)appsettingsjson["App"];
                //var downLoadFileRootPath = app["DownLoadFileRootPath"];//DownLoad
                foreach (var item in gbnode2)
                {

                    var tt = tableHtmlList.Where(p => p.Key == item.InnerText).FirstOrDefault().Value;
                    content = content + "<br>" + tt;
                }
            }
            return content;
        }
        /// <summary>
        /// 解析工序下工步名称内容
        /// </summary>
        /// <param name="regexInfo"></param>
        /// <param name="classTable"></param>
        /// <param name="classtr"></param>
        /// <returns></returns>
        public static List<JXString> GetGBFromGX(string regexInfo, string classtr)//, string classTable
        {
            //string sPattern =
            //@"(?is)<DIV\s+id=" + classTable + ">(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\\b).)*)*(?(o)(?!))</div>";
            //Regex regTable = new Regex(sPattern);
            List<JXString> lstSTX = new List<JXString>();
            var td = new List<string>();
            var p = new List<string>();
            //foreach (Match mTable in regTable.Matches(regexInfo).Cast<Match>())
            //{
            // var trs = @"<table" + classtr + ">(.|\\s)*?</table>";
            var trs = @"(?is)<table[^>]*?" + classtr + "[^>]*?>(?><table[^>]*>(?<o>)|</table>(?<-o>)|(?:(?!</?table\\b).)*)*(?(o)(?!))</table>";
            Regex regTr = new Regex(trs);
            foreach (Match mTr in regTr.Matches(regexInfo).Cast<Match>())  //Skip(1跳过tr 标题列
            {
                var data = new JXString();
                //查找每个TD的内容 包含td 后面 class等		
                var tda = @"(?<=<b[^>]*?[^>]*?>)([\s\S]*?)(?=</b>)";
                td = Regex.Matches(mTr.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                data.Name = td.Count == 0 ? "" : td[0];
                //var pa = @"(?<=<p[^>]*?[^>]*?>)([\s\S]*?)(?=</p>)";
                var pa = @"(?is)<td[^>]*?" + "[^>]*?>(?><td[^>]*>(?<o>)|</td>(?<-o>)|(?:(?!</?td\\b).)*)*(?(o)(?!))</td>";// @"(?<=<td[^>]*?[^>]*?>)([\s\S]*?)(?=</td>)";
                                                                                                                          //var pa = @"<td\s[^>]*>((?<mm><td[^>]*>)+|(?<-mm></td>)|[\s\S])*(?(mm)(?!))</td>";

                p = Regex.Matches(mTr.Value, pa).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                if (p.Count() == 0)
                {
                    var a = @"(?<=<td[^>]*?[^>]*?>)([\s\S]*?)(?=</td>)";
                    p = Regex.Matches(mTr.Value, a).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                }


                var str = p.Count == 0 ? "" : p[0].Split("</b>").LastOrDefault();
                data.Value = str;

                //data.Value = p.Count == 0 ? "" : p[0];
                //if (p.Count>1)
                //{
                //    var content = "";
                //    for (int i = 1; i < p.Count; i++)
                //    {
                //        content = content +"<p>"+ p[i]+"</p>";
                //    }
                //    data.Content = content;
                //}
                lstSTX.Add(data);
            }
            //}
            return lstSTX;
        }

        /// <summary>
        /// 解析工步表
        /// </summary>
        /// <param name="regexInfo"></param>
        /// <param name="classTable"></param>
        /// <param name="classtr"></param>
        /// <returns></returns>
        public static List<JLBData> GetGBFormByDiv(string regexInfo, string classTable, string classtr)
        {
            var datalist = new List<JLBData>();
            string sPattern =
               @"(?is)<DIV\s+id=" + classTable + ">(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\\b).)*)*(?(o)(?!))</div>";
            Regex regTable = new Regex(sPattern);
            foreach (Match mTable in regTable.Matches(regexInfo).Cast<Match>())
            {
                var trs = @"(?<=<table[^>]*?" + classtr + "[^>]*?>)([\\s\\S]+?)(?=</table>)";
                Regex regTr = new Regex(trs);
                foreach (Match mTr in regTr.Matches(mTable.Value).Cast<Match>())  //Skip(1跳过tr 标题列
                {
                    var tra = @"(?<=<td[^>]*? class=""FieldTitle""[^>]*?>)([\s\S]+?)(?=</td>)";
                    //var tds = Regex.Matches(mTr.Value, tra).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                    Regex regTd = new Regex(tra);
                    foreach (Match mTd in regTd.Matches(mTr.Value).Cast<Match>())
                    {
                        var data = new JLBData();
                        data.ValueList = new List<SYDetails>();
                        var tda = @"(?<=<div[^>]*?[^>]*?>)([\s\S]+?)(?=</div>)";
                        var sm = Regex.Matches(mTd.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                        if (sm.Count > 0)
                        {
                            var smn = sm[0];
                            if (smn.Contains("记录"))
                            {
                                data.Name = smn;

                                var tra2 = @"(?<=<tr class=""FieldRow"">)([\s\S]+?)(?=</tr>)";
                                Regex regTr2 = new Regex(tra2);
                                foreach (Match mTr2 in regTr2.Matches(mTr.Value).Cast<Match>())  //Skip(1跳过tr 标题列
                                {
                                    var value = new List<string>();
                                    var a = new SYDetails();
                                    //查找每个TD的内容 包含td 后面 class等		
                                    var tda2 = @"(?<=<td[^>]*?[^>]*?>)([\s\S]*?)(?=</td>)";
                                    var td2 = Regex.Matches(mTr2.Value, tda2).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                                    foreach (var td3 in td2)
                                    {
                                        value.Add(td3);
                                    }
                                    a.SYTwy = value;
                                    data.ValueList.Add(a);
                                }

                                datalist.Add(data);
                            }
                        }
                    }
                }
            }
            return datalist;
        }



        #region
        public async Task CreateFromProcessHtmlLocal(ProcessesDto processContent, Camc.Quality.TechDoc.TechDocDto input, TechniqueDto techniqueDto, List<string> tableClassNameList, string techniqueName, int type)
        {
            var tableHtmlList = new Dictionary<string, string>();
            //工步内容
            var workStepsHtml = HtmlToDB.ConvertHtmlLocal(processContent.F_HtmlContent, techniqueName, tableClassNameList, false, ref tableHtmlList);
            //表内容
            var saveHtml = HtmlToDB.ConvertHtmlLocal(processContent.F_HtmlContent, techniqueName, tableClassNameList, true, ref tableHtmlList);
            //processContent.ProcessesName = await GetprocessName(saveHtml);
            await CreateTableInfoFromSaveHtml(saveHtml, tableHtmlList, processContent, techniqueDto, tableClassNameList, workStepsHtml);
        }
        private async Task<string> GetprocessName(string html)
        {
            var classTable = @" class=""T""";
            string sPattern =
           @"(?is)<table[^>]*?" + classTable + "[^>]*?>[\\s\\S]+?</table>";
            Regex regTable = new Regex(sPattern);
            var name = "";
            foreach (Match mTable in regTable.Matches(html).Cast<Match>())
            {
                var tda = @"(?<=<td[^>]*?[^>]*?>)([\s\S]+?)(?=</td>)";
                var td = Regex.Matches(mTable.Value, tda).Cast<Match>().Select(mx => mx.Groups[0].Value.Trim().TrimStart().TrimEnd()).ToList();
                name = td.Count == 0 ? "" : td[0].Split(":").LastOrDefault();
                break;
            }

            return name;
        }
        #endregion

        public class SYDetails
        {
            public List<string> SYTwy { get; set; }
        }
        public class JXString
        {
            public string Name { get; set; }
            public string Value { get; set; }
            public string Content { get; set; }
        }
        public class JLBData
        {
            public string Name { get; set; }
            public List<SYDetails> ValueList { get; set; }
        }
        /// <summary>
        /// 变更管理更新数据
        /// </summary>
        /// <param name="workStep"></param>
        /// <param name="tableName"></param>
        /// <param name="mocId"></param>
        /// <returns></returns>
        public async Task<ResultMessage> InsertOrUpdateTable(WorkStepOutDto workStep, string tableName, Guid mocId)
        {
            ResultMessage resultMessage = new ResultMessage();
            try
            {
                var table = _tableBaseEntity.GetAllIncluding(a => a.RecordRequirements, b => b.InspectionSignature, c => c.MeasuredResult, d => d.Environment, e => e.MultiMedia).Where(d => d.WorkStepEntityId == workStep.Id).AsNoTracking();
                var tableList = table.Select(d => d.FormName).Distinct().ToList();
                Guid[] updateArr, deleteArr, addArr;
                var dataIdList = table.Where(d => d.FormName == tableName).Select(d => d.Id);
                var tempWork = _workStepEntityRepository.Get(workStep.Id);
                var tempProcess = _processesEntityRepository.Get(tempWork.ProcessesEntityId);
                string processNmae = "工序" + tempProcess.ProcessesSequence.ToString();
                string CurrentWorkName = "工步" + tempWork.WorkStepNumber.ToString();
                string historyName = processNmae + "," + CurrentWorkName;
                switch (tableName)
                {
                    case "装入件明细":
                        {
                            dataIdList = _loadPieceRepository.GetAll().Where(d => d.WorkStepEntityId == workStep.Id).Select(d => d.Id);
                            if (dataIdList.Count() > 0)
                            {
                                tableList.Add("装入件明细");
                            }
                            var localIdList = workStep.InsertDetails.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                              
                                foreach (var item in workStep.InsertDetails)
                                {
                                    var tempLoad = _loadPieceRepository.GetAll().Where(d => d.Id == item.Id).FirstOrDefault();
                                    if (tempLoad != null)
                                    {
                                        item.Id = Guid.NewGuid();
                                    }
                                    item.WorkStepEntityId = workStep.Id;
                                    item.Index = item.Sort;
                                  
                                    await _loadPieceRepository.InsertAsync(ObjectMapper.Map<LoadPieceEntity>(item));
                                }

                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                             
                                foreach (var item in workStep.InsertDetails)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var data = _loadPieceRepository.GetAll().Where(d => d.Id == item.Id).AsNoTracking();
                                        item.WorkStepEntityId = workStep.Id;
                                        item.Index = item.Sort;
                                        var stockNum = _storeStockContentRepsitory.GetAll().Count(d => d.LoadDetailsId == item.Id);
                                        if (stockNum > 0)
                                        {
                                            if (data.First().Number < item.Number)
                                            {
                                                resultMessage.code = 1;
                                                resultMessage.Message = item.Code + "请先解除配套!";
                                                return resultMessage;
                                            }
                                        }

                                        await _loadPieceRepository.UpdateAsync(ObjectMapper.Map<LoadPieceEntity>(item));
                                        var updateString = GetOperationHistoryDesc(ObjectMapper.Map<LoadPieceEntity>(item), data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        var tempLoad = _loadPieceRepository.GetAll().Where(d => d.Id == item.Id).FirstOrDefault();
                                        if (tempLoad != null)
                                        {
                                            item.Id = Guid.NewGuid();
                                        }
                                        item.Index = item.Sort;
                                        item.WorkStepEntityId = workStep.Id;
                                        await _loadPieceRepository.InsertAsync(ObjectMapper.Map<LoadPieceEntity>(item));
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(ObjectMapper.Map<LoadPieceEntity>(item), null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    item.WorkStepEntityId = workStep.Id;
                                    //    await _loadPieceRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(ObjectMapper.Map<LoadPieceEntity>(item), null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _loadPieceRepository.Get(item);
                                    var stockNum = _storeStockContentRepsitory.GetAll().Count(d => d.LoadDetailsId == deleteItem.Id);
                                    if (stockNum > 0)
                                    {
                                        resultMessage.code = 1;
                                        resultMessage.Message = deleteItem.Code + "请先解除配套!";
                                        return resultMessage;
                                    }
                                    await _loadPieceRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }
                            break;
                        }

                    case "制造资源":
                        {
                            dataIdList = _makeResourcesEntityRepository.GetAll().Where(d => d.WorkStepEntityId == workStep.Id).Select(d => d.Id);
                            if (dataIdList.Count() > 0)
                            {
                                tableList.Add("制造资源");
                            }
                            var localIdList = workStep.ManufacturingResources.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                
                                foreach (var item in workStep.ManufacturingResources)
                                {
                                    item.WorkStepEntityId = workStep.Id;
                                    item.Index = item.Sort;
                                    await _makeResourcesEntityRepository.InsertAsync(ObjectMapper.Map<MakeResourcesEntity>(item));

                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                               
                                foreach (var item in workStep.ManufacturingResources)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        item.WorkStepEntityId = workStep.Id;
                                        item.Index = item.Sort;
                                        var data = _makeResourcesEntityRepository.GetAll().Where(d => d.Id == item.Id).AsNoTracking();
                                        await _makeResourcesEntityRepository.UpdateAsync(ObjectMapper.Map<MakeResourcesEntity>(item));

                                        var updateString = GetOperationHistoryDesc(ObjectMapper.Map<MakeResourcesEntity>(item), data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        item.WorkStepEntityId = workStep.Id;
                                        item.Index = item.Sort;
                                        await _makeResourcesEntityRepository.InsertAsync(ObjectMapper.Map<MakeResourcesEntity>(item));
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(ObjectMapper.Map<MakeResourcesEntity>(item), null, tableName, 1));
                                    }
                                   
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    item.WorkStepEntityId = workStep.Id;
                                    //    await _makeResourcesEntityRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(ObjectMapper.Map<MakeResourcesEntity>(item), null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _makeResourcesEntityRepository.Get(item);
                                    await _makeResourcesEntityRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "视频":
                        {
                            dataIdList = _videoEntityRepository.GetAll().Where(d => d.WorkStepEntityId == workStep.Id).Select(d => d.Id);
                            if (dataIdList.Count() > 0)
                            {
                                tableList.Add("视频");
                            }
                            var localIdList = workStep.Video.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                              
                                foreach (var item in workStep.Video)
                                {
                                    item.WorkStepEntityId = workStep.Id;
                                    item.Index = item.Sort;
                                    await _videoEntityRepository.InsertAsync(ObjectMapper.Map<VideoEntity>(item));

                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                              
                                foreach (var item in workStep.Video)
                                {
                                    item.Index = item.Sort;
                                    if (updateArr.Contains(item.Id))
                                    {
                                        item.WorkStepEntityId = workStep.Id;
                                       
                                        var data = _videoEntityRepository.GetAll().Where(d => d.Id == item.Id).AsNoTracking();
                                        await _videoEntityRepository.UpdateAsync(ObjectMapper.Map<VideoEntity>(item));
                                        var updateString = GetOperationHistoryDesc(ObjectMapper.Map<VideoEntity>(item), data, tableName, 3);
                                        if (updateString != "") 
                                        { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        item.WorkStepEntityId = workStep.Id;
                                        await _videoEntityRepository.InsertAsync(ObjectMapper.Map<VideoEntity>(item));
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(ObjectMapper.Map<VideoEntity>(item), null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    item.WorkStepEntityId = workStep.Id;
                                    //    await _videoEntityRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(ObjectMapper.Map<VideoEntity>(item), null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _videoEntityRepository.Get(item);
                                    await _videoEntityRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "通用总装数据记录表":
                        {
                            var localIdList = workStep.Assemble.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Assemble)
                                {
                                    通用总装数据记录表 record = new 通用总装数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _totalDataRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Assemble)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<AssembleDto>(query));
                                        通用总装数据记录表 record = new 通用总装数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _totalDataRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") 
                                        { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }

                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用总装数据记录表 record = new 通用总装数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _totalDataRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _totalDataRepository.Get(item);
                                    await _totalDataRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }

                            break;
                        }
                    case "通用记录表":
                        {
                            var localIdList = workStep.GeneralRecords.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.GeneralRecords)
                                {
                                    通用记录表 record = new 通用记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _generalRecordsRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.GeneralRecords)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<GeneralRecordsDto>(query));
                                        通用记录表 record = new 通用记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _generalRecordsRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用记录表 record = new 通用记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _generalRecordsRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _generalRecordsRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _generalRecordsRepository.Get(item);
                                    await _generalRecordsRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "胶液配比情况记录表":
                        {
                            var localIdList = workStep.GlueSolution.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.GlueSolution)
                                {
                                    胶液配比情况记录表 record = new 胶液配比情况记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.FirstDrawingName);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _liquidRatioRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.GlueSolution)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<GlueSolutionDto>(query));
                                        胶液配比情况记录表 record = new 胶液配比情况记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.FirstDrawingName);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _liquidRatioRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        胶液配比情况记录表 record = new 胶液配比情况记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.FirstDrawingName);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _liquidRatioRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _liquidRatioRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _liquidRatioRepository.Get(item);
                                    await _liquidRatioRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "舱口盖开闭记录表":
                        {
                            var localIdList = workStep.Hatch.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Hatch)
                                {
                                    舱口盖开闭记录表 record = new 舱口盖开闭记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordItem, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _hatchRepository.InsertAsync(record);

                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Hatch)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<HatchOpenShutDto>(query));
                                        舱口盖开闭记录表 record = new 舱口盖开闭记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordItem, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _hatchRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        舱口盖开闭记录表 record = new 舱口盖开闭记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordItem, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _hatchRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _hatchRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _hatchRepository.Get(item);
                                    await _hatchRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "进箱舱登记表":
                        {
                            var localIdList = workStep.InCabin.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InCabin)
                                {
                                    进箱舱登记表 record = new 进箱舱登记表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.Model, item.FisrtDrawingNum, item.FirstDrawingName);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.Remarks, item.RecordRequire, item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _enterRegisterRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InCabin)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InCabinDto>(query));
                                        进箱舱登记表 record = new 进箱舱登记表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.Model, item.FisrtDrawingNum, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.Remarks, item.RecordRequire, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _enterRegisterRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        进箱舱登记表 record = new 进箱舱登记表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.Model, item.FisrtDrawingNum, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.Remarks, item.RecordRequire, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _enterRegisterRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _enterRegisterRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _enterRegisterRepository.Get(item);
                                    await _enterRegisterRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }
                            break;
                        }
                    case "具有证明书的主要零件记录表":
                        {
                            var localIdList = workStep.MainParts.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.MainParts)
                                {
                                    具有证明书的主要零件记录表 record = new 具有证明书的主要零件记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.SecondDrawingNum, item.Certificate);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _mainPartsRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.MainParts)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<MainPartsDto>(query));
                                        具有证明书的主要零件记录表 record = new 具有证明书的主要零件记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.SecondDrawingNum, item.Certificate);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _mainPartsRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        具有证明书的主要零件记录表 record = new 具有证明书的主要零件记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.SecondDrawingNum, item.Certificate);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _mainPartsRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _mainPartsRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _mainPartsRepository.Get(item);
                                    await _mainPartsRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "力矩记录表":
                        {
                            var localIdList = workStep.Moment.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Moment)
                                {
                                    力矩记录表 record = new 力矩记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _momentRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Moment)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<MomentRecordingDto>(query));
                                        力矩记录表 record = new 力矩记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _momentRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        力矩记录表 record = new 力矩记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _momentRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _momentRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _momentRepository.Get(item);
                                    await _momentRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "通用多媒体记录表":   //RecordElement 为 FisrtDrawingNum
                        {
                            var localIdList = workStep.MultimediaRecord.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.MultimediaRecord)
                                {
                                    通用多媒体记录表 record = new 通用多媒体记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    await _multiMediaRepository.InsertAsync(record);

                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.MultimediaRecord)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<MultimediaRecordDto>(query));
                                        通用多媒体记录表 record = new 通用多媒体记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.Id = item.Id;
                                        await _multiMediaRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用多媒体记录表 record = new 通用多媒体记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        await _multiMediaRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _multiMediaRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _multiMediaRepository.Get(item);
                                    await _multiMediaRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "通用力矩复校记录表":
                        {
                            var localIdList = workStep.TorqueReCalibration.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.TorqueReCalibration)
                                {
                                    通用力矩复校记录表 record = new 通用力矩复校记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _momentRecordRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.TorqueReCalibration)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<TorqueReCalibrationDto>(query));
                                        通用力矩复校记录表 record = new 通用力矩复校记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _momentRecordRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用力矩复校记录表 record = new 通用力矩复校记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _momentRecordRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _momentRecordRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _momentRecordRepository.Get(item);
                                    await _momentRecordRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "质量控制记录表":
                        {
                            var localIdList = workStep.QualityControl.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.QualityControl)
                                {
                                    质量控制记录表 record = new 质量控制记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _controlrecordRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.QualityControl)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<QualityControlDto>(query));
                                        质量控制记录表 record = new 质量控制记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _controlrecordRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        质量控制记录表 record = new 质量控制记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _controlrecordRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _controlrecordRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _controlrecordRepository.Get(item);
                                    await _controlrecordRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电缆插头防水防热记录表":
                        {
                            var localIdList = workStep.CablePlugWaterFireProofControl.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CablePlugWaterFireProofControl)
                                {

                                    电缆插头防水防热记录表 record = new 电缆插头防水防热记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _cableRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CablePlugWaterFireProofControl)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CablePlugWaterFireProofDto>(query));
                                        电缆插头防水防热记录表 record = new 电缆插头防水防热记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _cableRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电缆插头防水防热记录表 record = new 电缆插头防水防热记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _cableRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _cableRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _cableRepository.Get(item);
                                    await _cableRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "波纹管变形记录表":
                        {
                            var localIdList = workStep.BellowsDeformation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.BellowsDeformation)
                                {

                                    波纹管变形记录表 record = new 波纹管变形记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.RecordElement, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _rippleRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.BellowsDeformation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<BellowsDeformationDto>(query));
                                        波纹管变形记录表 record = new 波纹管变形记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _rippleRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        波纹管变形记录表 record = new 波纹管变形记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _rippleRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _rippleRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _rippleRepository.Get(item);
                                    await _rippleRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电连接器插接记录表":
                        {
                            var localIdList = workStep.ElectricalConnectInsertion.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ElectricalConnectInsertion)
                                {
                                    电连接器插接记录表 record = new 电连接器插接记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo, item.SecondPhotoNo, item.ThirdPhotoNo, item.FourthPhotoNo);
                                    await _connectorRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ElectricalConnectInsertion)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ElectricalConnectInsertionDto>(query));
                                        电连接器插接记录表 record = new 电连接器插接记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo, item.SecondPhotoNo, item.ThirdPhotoNo, item.FourthPhotoNo);
                                        record.Id = item.Id;
                                        await _connectorRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电连接器插接记录表 record = new 电连接器插接记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo, item.SecondPhotoNo, item.ThirdPhotoNo, item.FourthPhotoNo);
                                        await _connectorRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _connectorRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _connectorRepository.Get(item);
                                    await _connectorRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "舱口盖开闭测试记录表":
                        {
                            var localIdList = workStep.HatchOpenShutTest.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.HatchOpenShutTest)
                                {
                                    舱口盖开闭测试记录表 record = new 舱口盖开闭测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.FirstDrawingName);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _hatchtestRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.HatchOpenShutTest)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<HatchOpenShutTestDto>(query));
                                        舱口盖开闭测试记录表 record = new 舱口盖开闭测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _hatchtestRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        舱口盖开闭测试记录表 record = new 舱口盖开闭测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _hatchtestRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _hatchtestRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _hatchtestRepository.Get(item);
                                    await _hatchtestRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "产品接地状态检查记录表":
                        {
                            var localIdList = workStep.ProductGroundingStatus.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ProductGroundingStatus)
                                {
                                    产品接地状态检查记录表 record = new 产品接地状态检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ToolUsed);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _productgroundingRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ProductGroundingStatus)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ProductGroundingStatusDto>(query));
                                        产品接地状态检查记录表 record = new 产品接地状态检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ToolUsed);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _productgroundingRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        产品接地状态检查记录表 record = new 产品接地状态检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.ToolUsed);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _productgroundingRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _productgroundingRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _productgroundingRepository.Get(item);
                                    await _productgroundingRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "强制检验点记录表":
                        {
                            var localIdList = workStep.ForcedCheckpoint.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ForcedCheckpoint)
                                {
                                    强制检验点记录表 record = new 强制检验点记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _compulsoryinspectionRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ForcedCheckpoint)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ForcedCheckpointDto>(query));
                                        强制检验点记录表 record = new 强制检验点记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _compulsoryinspectionRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        强制检验点记录表 record = new 强制检验点记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _compulsoryinspectionRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _compulsoryinspectionRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _compulsoryinspectionRepository.Get(item);
                                    await _compulsoryinspectionRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "自动关闭口盖检查记录表":
                        {
                            var localIdList = workStep.AutomaticShutoff.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.AutomaticShutoff)
                                {
                                    自动关闭口盖检查记录表 record = new 自动关闭口盖检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordItem);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _autocloseRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.AutomaticShutoff)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<AutomaticShutoffDto>(query));
                                        自动关闭口盖检查记录表 record = new 自动关闭口盖检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordItem);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _autocloseRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        自动关闭口盖检查记录表 record = new 自动关闭口盖检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordItem);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _autocloseRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _autocloseRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _autocloseRepository.Get(item);
                                    await _autocloseRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "伺服机构工艺拉杆长度记录表":
                        {
                            var localIdList = workStep.Servomechanism.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Servomechanism)
                                {
                                    伺服机构工艺拉杆长度记录表 record = new 伺服机构工艺拉杆长度记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _servomechanismRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Servomechanism)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ServomechanismDto>(query));
                                        伺服机构工艺拉杆长度记录表 record = new 伺服机构工艺拉杆长度记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _servomechanismRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        伺服机构工艺拉杆长度记录表 record = new 伺服机构工艺拉杆长度记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _servomechanismRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _servomechanismRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _servomechanismRepository.Get(item);
                                    await _servomechanismRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "状态检查表":
                        {
                            var localIdList = workStep.StatusCheck.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.StatusCheck)
                                {
                                    状态检查表 record = new 状态检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _statuscheckRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.StatusCheck)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<StatusCheckDto>(query));
                                        状态检查表 record = new 状态检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _statuscheckRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        状态检查表 record = new 状态检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _statuscheckRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _statuscheckRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _statuscheckRepository.Get(item);
                                    await _statuscheckRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "问题记录表":
                        {
                            var localIdList = workStep.ProblemRecord.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ProblemRecord)
                                {
                                    问题记录表 record = new 问题记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.AbnormalRecord);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    await _problemrecordRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ProblemRecord)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ProblemRecordDto>(query));
                                        问题记录表 record = new 问题记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.AbnormalRecord);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.Id = item.Id;
                                        await _problemrecordRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        问题记录表 record = new 问题记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.AbnormalRecord);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        await _problemrecordRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _problemrecordRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _problemrecordRepository.Get(item);
                                    await _problemrecordRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "爆索尺寸测量记录表":
                        {
                            var localIdList = workStep.DetonatingCableSize.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.DetonatingCableSize)
                                {
                                    爆索尺寸测量记录表 record = new 爆索尺寸测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    await _detonatingcordRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.DetonatingCableSize)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<DetonatingCableSizeDto>(query));
                                        爆索尺寸测量记录表 record = new 爆索尺寸测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.Id = item.Id;
                                        await _detonatingcordRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        爆索尺寸测量记录表 record = new 爆索尺寸测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        await _detonatingcordRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _detonatingcordRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _detonatingcordRepository.Get(item);
                                    await _detonatingcordRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "整流罩星箭分离弹簧压缩数据记录表":
                        {
                            var localIdList = workStep.ReleaseSpringCompression.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ReleaseSpringCompression)
                                {
                                    整流罩星箭分离弹簧压缩数据记录表 record = new 整流罩星箭分离弹簧压缩数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.ProductNum, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _fairingstararrowRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ReleaseSpringCompression)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ReleaseSpringCompressionDto>(query));
                                        整流罩星箭分离弹簧压缩数据记录表 record = new 整流罩星箭分离弹簧压缩数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.ProductNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _fairingstararrowRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        整流罩星箭分离弹簧压缩数据记录表 record = new 整流罩星箭分离弹簧压缩数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.ProductNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _fairingstararrowRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _fairingstararrowRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _fairingstararrowRepository.Get(item);
                                    await _fairingstararrowRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "载荷支架组合体形位数据记录表":
                        {
                            var localIdList = workStep.LoadBracket.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LoadBracket)
                                {
                                    载荷支架组合体形位数据记录表 record = new 载荷支架组合体形位数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordItem, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _loadbracketRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LoadBracket)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LoadBracketDto>(query));
                                        载荷支架组合体形位数据记录表 record = new 载荷支架组合体形位数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordItem, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _loadbracketRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        载荷支架组合体形位数据记录表 record = new 载荷支架组合体形位数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordItem, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _loadbracketRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _loadbracketRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _loadbracketRepository.Get(item);
                                    await _loadbracketRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "设计签署总装数据记录表":
                        {
                            var localIdList = workStep.DesignGeneralAssemble.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.DesignGeneralAssemble)
                                {
                                    设计签署总装数据记录表 record = new 设计签署总装数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _shejiqianshuzongzhuangshujujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.DesignGeneralAssemble)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<DesignGeneralAssembleDto>(query));
                                        设计签署总装数据记录表 record = new 设计签署总装数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _shejiqianshuzongzhuangshujujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        设计签署总装数据记录表 record = new 设计签署总装数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _shejiqianshuzongzhuangshujujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _shejiqianshuzongzhuangshujujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _shejiqianshuzongzhuangshujujilubiaoRepository.Get(item);
                                    await _shejiqianshuzongzhuangshujujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "管路活门气密点检查记录表皂泡法":
                        {
                            var localIdList = workStep.SoapBubble.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.SoapBubble)
                                {
                                    管路活门气密点检查记录表皂泡法 record = new 管路活门气密点检查记录表皂泡法(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    await _soapbubblemethodRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.SoapBubble)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<SoapBubbleDto>(query));
                                        管路活门气密点检查记录表皂泡法 record = new 管路活门气密点检查记录表皂泡法(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Id = item.Id;
                                        await _soapbubblemethodRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        管路活门气密点检查记录表皂泡法 record = new 管路活门气密点检查记录表皂泡法(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        await _soapbubblemethodRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _soapbubblemethodRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _soapbubblemethodRepository.Get(item);
                                    await _soapbubblemethodRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "管路活门气密点检查记录表氦质谱法":
                        {
                            var localIdList = workStep.HeliumMassSpectrometry.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.HeliumMassSpectrometry)
                                {
                                    管路活门气密点检查记录表氦质谱法 record = new 管路活门气密点检查记录表氦质谱法(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity, item.AtmPressure);
                                    await _heliummassspectrometryRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.HeliumMassSpectrometry)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<HeliumMassSpectrometryDto>(query));
                                        管路活门气密点检查记录表氦质谱法 record = new 管路活门气密点检查记录表氦质谱法(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity, item.AtmPressure);
                                        record.Id = item.Id;
                                        await _heliummassspectrometryRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        管路活门气密点检查记录表氦质谱法 record = new 管路活门气密点检查记录表氦质谱法(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.FisrtDrawingNum, item.SecondDrawingNum, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.DesignerDemand, item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity, item.AtmPressure);
                                        await _heliummassspectrometryRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _heliummassspectrometryRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _heliummassspectrometryRepository.Get(item);
                                    await _heliummassspectrometryRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "除了打保险防松外的总装直属件记录表":
                        {
                            var localIdList = workStep.FinalAssemblyParts.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.FinalAssemblyParts)
                                {
                                    除了打保险防松外的总装直属件记录表 record = new 除了打保险防松外的总装直属件记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.FisrtDrawingNum, item.SecondDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.DesignerDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _finalassemblyRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.FinalAssemblyParts)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<FinalAssemblyPartsDto>(query));
                                        除了打保险防松外的总装直属件记录表 record = new 除了打保险防松外的总装直属件记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.FisrtDrawingNum, item.SecondDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _finalassemblyRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        除了打保险防松外的总装直属件记录表 record = new 除了打保险防松外的总装直属件记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.FisrtDrawingNum, item.SecondDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _finalassemblyRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _finalassemblyRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _finalassemblyRepository.Get(item);
                                    await _finalassemblyRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "传感器安装测试记录情况统计记录表":
                        {
                            var localIdList = workStep.SensorInstallation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.SensorInstallation)
                                {
                                    传感器安装测试记录情况统计记录表 record = new 传感器安装测试记录情况统计记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.ParentProductName, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement, item.RecordItem, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.RecordMainopoint, item.DesignerDemand, item.ProcessorDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _sensorinstallationRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.SensorInstallation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<SensorInstallationDto>(query));
                                        传感器安装测试记录情况统计记录表 record = new 传感器安装测试记录情况统计记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.ParentProductName, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement, item.RecordItem, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.RecordMainopoint, item.DesignerDemand, item.ProcessorDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _sensorinstallationRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        传感器安装测试记录情况统计记录表 record = new 传感器安装测试记录情况统计记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductNum, item.ParentProductName, item.FisrtDrawingNum, item.FirstDrawingName, item.RecordElement, item.RecordItem, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.RecordMainopoint, item.DesignerDemand, item.ProcessorDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _sensorinstallationRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _sensorinstallationRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _sensorinstallationRepository.Get(item);
                                    await _sensorinstallationRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "插头状态检查表":
                        {
                            var localIdList = workStep.PlugStatus.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.PlugStatus)
                                {
                                    插头状态检查表 record = new 插头状态检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    await _plugstatusRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.PlugStatus)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<PlugStatusDto>(query));
                                        插头状态检查表 record = new 插头状态检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.Id = item.Id;
                                        await _plugstatusRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        插头状态检查表 record = new 插头状态检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        await _plugstatusRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _plugstatusRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _plugstatusRepository.Get(item);
                                    await _plugstatusRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "惯组安装记录表一":
                        {
                            var localIdList = workStep.FirstIMUInstallation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.FirstIMUInstallation)
                                {
                                    惯组安装记录表一 record = new 惯组安装记录表一(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _guanzuanzhuangjilubiao1Repository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.FirstIMUInstallation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<FirstIMUInstallationDto>(query));
                                        惯组安装记录表一 record = new 惯组安装记录表一(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _guanzuanzhuangjilubiao1Repository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        惯组安装记录表一 record = new 惯组安装记录表一(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _guanzuanzhuangjilubiao1Repository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _guanzuanzhuangjilubiao1Repository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _guanzuanzhuangjilubiao1Repository.Get(item);
                                    await _guanzuanzhuangjilubiao1Repository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "惯组安装记录表二":
                        {
                            var localIdList = workStep.SecondIMUInstallation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.SecondIMUInstallation)
                                {
                                    惯组安装记录表二 record = new 惯组安装记录表二(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordItem, item.ToolUsed);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _guanzuanzhuangjilubiao2Repository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.SecondIMUInstallation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<SecondIMUInstallationDto>(query));
                                        惯组安装记录表二 record = new 惯组安装记录表二(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordItem, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _guanzuanzhuangjilubiao2Repository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        惯组安装记录表二 record = new 惯组安装记录表二(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordItem, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _guanzuanzhuangjilubiao2Repository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _guanzuanzhuangjilubiao2Repository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _guanzuanzhuangjilubiao2Repository.Get(item);
                                    await _guanzuanzhuangjilubiao2Repository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电缆高度测量记录表":
                        {
                            var localIdList = workStep.CableHeight.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CableHeight)
                                {
                                    电缆高度测量记录表 record = new 电缆高度测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    await _dianlangaoduceliangjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CableHeight)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CableHeightDto>(query));
                                        电缆高度测量记录表 record = new 电缆高度测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.Id = item.Id;
                                        await _dianlangaoduceliangjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电缆高度测量记录表 record = new 电缆高度测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        await _dianlangaoduceliangjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dianlangaoduceliangjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dianlangaoduceliangjilubiaoRepository.Get(item);
                                    await _dianlangaoduceliangjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电缆剥线试验记录表低频":  // SecondMeasuredValues=》  FirstConfirmResult
                        {
                            var localIdList = workStep.LowFrequencyCableStripping.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LowFrequencyCableStripping)
                                {
                                    电缆剥线试验记录表低频 record = new 电缆剥线试验记录表低频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.SecondToolUsed, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    await _dianlanboxianshiyanjilubiaodipinRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LowFrequencyCableStripping)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LowFrequencyCableStrippingDto>(query));
                                        电缆剥线试验记录表低频 record = new 电缆剥线试验记录表低频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.SecondToolUsed, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.Id = item.Id;
                                        await _dianlanboxianshiyanjilubiaodipinRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电缆剥线试验记录表低频 record = new 电缆剥线试验记录表低频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.SecondToolUsed, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        await _dianlanboxianshiyanjilubiaodipinRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dianlanboxianshiyanjilubiaodipinRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dianlanboxianshiyanjilubiaodipinRepository.Get(item);
                                    await _dianlanboxianshiyanjilubiaodipinRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }
                            break;
                        }
                    case "压接实验测量记录表低频":
                        {
                            var localIdList = workStep.LowCrimpingExperiment.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LowCrimpingExperiment)
                                {
                                    压接实验测量记录表低频 record = new 压接实验测量记录表低频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.RecordItem);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    await _yajieshiyanceliangjilubiaodipinRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LowCrimpingExperiment)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LowCrimpingExperimentDto>(query));
                                        压接实验测量记录表低频 record = new 压接实验测量记录表低频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.Id = item.Id;
                                        await _yajieshiyanceliangjilubiaodipinRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        压接实验测量记录表低频 record = new 压接实验测量记录表低频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        await _yajieshiyanceliangjilubiaodipinRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _yajieshiyanceliangjilubiaodipinRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _yajieshiyanceliangjilubiaodipinRepository.Get(item);
                                    await _yajieshiyanceliangjilubiaodipinRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电缆剥线试验记录表高频":  //FirstConfirmResult
                        {
                            var localIdList = workStep.HighFrequencyCableStripping.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.HighFrequencyCableStripping)
                                {
                                    电缆剥线试验记录表高频 record = new 电缆剥线试验记录表高频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.SecondToolUsed, item.RecordItem);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.SecondMeasuredValues, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    await _dianlanboxianshiyanjilubiaogaopinRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.HighFrequencyCableStripping)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<HighFrequencyCableStrippingDto>(query));
                                        电缆剥线试验记录表高频 record = new 电缆剥线试验记录表高频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.SecondToolUsed, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.Id = item.Id;
                                        await _dianlanboxianshiyanjilubiaogaopinRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电缆剥线试验记录表高频 record = new 电缆剥线试验记录表高频(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ToolUsed, item.SecondToolUsed, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        await _dianlanboxianshiyanjilubiaogaopinRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dianlanboxianshiyanjilubiaogaopinRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dianlanboxianshiyanjilubiaogaopinRepository.Get(item);
                                    await _dianlanboxianshiyanjilubiaogaopinRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "仪器接收检查记录表":  //SecondMeasuredValues=》FirstConfirmResult
                        {
                            var localIdList = workStep.InstrumentCheck.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InstrumentCheck)
                                {
                                    仪器接收检查记录表 record = new 仪器接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult, item.SecondConfirmResult, item.ThirdConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    await _yiqijieshoujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InstrumentCheck)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InstrumentCheckDto>(query));
                                        仪器接收检查记录表 record = new 仪器接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult, item.SecondConfirmResult, item.ThirdConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.Id = item.Id;
                                        await _yiqijieshoujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        仪器接收检查记录表 record = new 仪器接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult, item.SecondConfirmResult, item.ThirdConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        await _yiqijieshoujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _yiqijieshoujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _yiqijieshoujianchajilubiaoRepository.Get(item);
                                    await _yiqijieshoujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电缆接收检查记录表":   //SecondMeasuredValues=>FirstConfirmResult
                        {
                            var localIdList = workStep.CableReceivingInspection.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CableReceivingInspection)
                                {
                                    电缆接收检查记录表 record = new 电缆接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.SecondConfirmResult, item.ThirdConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    await _dianlanjieshoujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CableReceivingInspection)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CableReceivingInspectionDto>(query));
                                        电缆接收检查记录表 record = new 电缆接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.SecondConfirmResult, item.ThirdConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.Id = item.Id;
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        await _dianlanjieshoujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电缆接收检查记录表 record = new 电缆接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.SecondConfirmResult, item.ThirdConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        await _dianlanjieshoujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dianlanjieshoujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dianlanjieshoujianchajilubiaoRepository.Get(item);
                                    await _dianlanjieshoujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "箭地接口保护件检查记录表":
                        {
                            var localIdList = workStep.ArrowInterfaceProtectCheck.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ArrowInterfaceProtectCheck)
                                {
                                    箭地接口保护件检查记录表 record = new 箭地接口保护件检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.RecordRequire);
                                    await _jiandijiekoubaohujianjianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ArrowInterfaceProtectCheck)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ArrowInterfaceProtectCheckDto>(query));
                                        箭地接口保护件检查记录表 record = new 箭地接口保护件检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.RecordRequire);
                                        record.Id = item.Id;
                                        await _jiandijiekoubaohujianjianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        箭地接口保护件检查记录表 record = new 箭地接口保护件检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.RecordRequire);
                                        await _jiandijiekoubaohujianjianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _jiandijiekoubaohujianjianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _jiandijiekoubaohujianjianchajilubiaoRepository.Get(item);
                                    await _jiandijiekoubaohujianjianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "通用检查记录表"://RecordElement=>RecordItem
                        {
                            var localIdList = workStep.InspectionRecord.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InspectionRecord)
                                {
                                    通用检查记录表 record = new 通用检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordItem);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    await _tongyongjianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InspectionRecord)
                                {

                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InspectionRecordDto>(query));
                                        通用检查记录表 record = new 通用检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.Id = item.Id;
                                        await _tongyongjianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用检查记录表 record = new 通用检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        await _tongyongjianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _tongyongjianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _tongyongjianchajilubiaoRepository.Get(item);
                                    await _tongyongjianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "对接面形位记录表"://FirstMeasuredValues RecordElement
                        {
                            var localIdList = workStep.DockSurfaceMorpheme.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.DockSurfaceMorpheme)
                                {
                                    对接面形位记录表 record = new 对接面形位记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement, item.ToolUsed);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    await _duijiemianxingweijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.DockSurfaceMorpheme)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<DockSurfaceMorphemeDto>(query));
                                        对接面形位记录表 record = new 对接面形位记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.Id = item.Id;
                                        await _duijiemianxingweijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        对接面形位记录表 record = new 对接面形位记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        await _duijiemianxingweijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _duijiemianxingweijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _duijiemianxingweijilubiaoRepository.Get(item);
                                    await _duijiemianxingweijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "整流罩锉修记录表":
                        {
                            var localIdList = workStep.FilingFileRepair.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.FilingFileRepair)
                                {
                                    整流罩锉修记录表 record = new 整流罩锉修记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    await _zhengliuzhaocuoxiujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.FilingFileRepair)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<FilingFileRepairDto>(query));
                                        整流罩锉修记录表 record = new 整流罩锉修记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.Id = item.Id;
                                        await _zhengliuzhaocuoxiujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        整流罩锉修记录表 record = new 整流罩锉修记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        await _zhengliuzhaocuoxiujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _zhengliuzhaocuoxiujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _zhengliuzhaocuoxiujilubiaoRepository.Get(item);
                                    await _zhengliuzhaocuoxiujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "整流罩安装后检查记录表":
                        {
                            var localIdList = workStep.CheckFairingAfterInstallation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CheckFairingAfterInstallation)
                                {

                                    整流罩安装后检查记录表 record = new 整流罩安装后检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CheckFairingAfterInstallation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CheckFairingAfterInstallationDto>(query));
                                        整流罩安装后检查记录表 record = new 整流罩安装后检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        整流罩安装后检查记录表 record = new 整流罩安装后检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.Get(item);
                                    await _zhengliuzhaoanzhuanghoujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "导管检查记录表":
                        {
                            var localIdList = workStep.Catheterization.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Catheterization)
                                {
                                    导管检查记录表 record = new 导管检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _daoguanjianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Catheterization)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CatheterizationDto>(query));
                                        导管检查记录表 record = new 导管检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _daoguanjianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        导管检查记录表 record = new 导管检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _daoguanjianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _daoguanjianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _daoguanjianchajilubiaoRepository.Get(item);
                                    await _daoguanjianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "管路上箭前吹除记录表":
                        {
                            var localIdList = workStep.BlowPipeArrow.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.BlowPipeArrow)
                                {
                                    管路上箭前吹除记录表 record = new 管路上箭前吹除记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _guanlushangjianqianchuichujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.BlowPipeArrow)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<BlowPipeArrowDto>(query));
                                        管路上箭前吹除记录表 record = new 管路上箭前吹除记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _guanlushangjianqianchuichujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        管路上箭前吹除记录表 record = new 管路上箭前吹除记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _guanlushangjianqianchuichujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _guanlushangjianqianchuichujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _guanlushangjianqianchuichujilubiaoRepository.Get(item);
                                    await _guanlushangjianqianchuichujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "气封管流量测试记录表":
                        {
                            var localIdList = workStep.GasPipeTest.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.GasPipeTest)
                                {
                                    气封管流量测试记录表 record = new 气封管流量测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.RecordRequire);
                                    await _qifengguanliuliangceshijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.GasPipeTest)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<GasPipeTestDto>(query));
                                        气封管流量测试记录表 record = new 气封管流量测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.RecordRequire);
                                        record.Id = item.Id;
                                        await _qifengguanliuliangceshijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        气封管流量测试记录表 record = new 气封管流量测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.RecordRequire);
                                        await _qifengguanliuliangceshijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _qifengguanliuliangceshijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _qifengguanliuliangceshijilubiaoRepository.Get(item);
                                    await _qifengguanliuliangceshijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "阀门气瓶过滤器流量计输送管金属软管等检查记录表":
                        {
                            var localIdList = workStep.ValvesGasInspection.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ValvesGasInspection)
                                {
                                    阀门气瓶过滤器流量计输送管金属软管等检查记录表 record = new 阀门气瓶过滤器流量计输送管金属软管等检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ValvesGasInspection)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ValvesGasInspectionDto>(query));
                                        阀门气瓶过滤器流量计输送管金属软管等检查记录表 record = new 阀门气瓶过滤器流量计输送管金属软管等检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        阀门气瓶过滤器流量计输送管金属软管等检查记录表 record = new 阀门气瓶过滤器流量计输送管金属软管等检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.Get(item);
                                    await _famenqipingguolvqiliuliangjishusongguanjinshuruanguandengjianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "单机安装位置记录表":
                        {
                            var localIdList = workStep.InstallationLocation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InstallationLocation)
                                {
                                    单机安装位置记录表 record = new 单机安装位置记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _danjianzhuangweizhijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InstallationLocation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InstallationLocationDto>(query));
                                        单机安装位置记录表 record = new 单机安装位置记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _danjianzhuangweizhijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        单机安装位置记录表 record = new 单机安装位置记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _danjianzhuangweizhijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _danjianzhuangweizhijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _danjianzhuangweizhijilubiaoRepository.Get(item);
                                    await _danjianzhuangweizhijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "安装距离记录表":
                        {
                            var localIdList = workStep.InstallationDistance.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InstallationDistance)
                                {
                                    安装距离记录表 record = new 安装距离记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordElement, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _anzhuangjulijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InstallationDistance)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InstallationDistanceDto>(query));
                                        安装距离记录表 record = new 安装距离记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _anzhuangjulijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        安装距离记录表 record = new 安装距离记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _anzhuangjulijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _anzhuangjulijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _anzhuangjulijilubiaoRepository.Get(item);
                                    await _anzhuangjulijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "小导管卡箍间距测量表":
                        {
                            var localIdList = workStep.MeasurementSpacingConduit.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.MeasurementSpacingConduit)
                                {
                                    小导管卡箍间距测量表 record = new 小导管卡箍间距测量表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _xiaodaoguankagujianjuceliangbiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.MeasurementSpacingConduit)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<MeasurementSpacingConduitDto>(query));
                                        小导管卡箍间距测量表 record = new 小导管卡箍间距测量表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _xiaodaoguankagujianjuceliangbiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        小导管卡箍间距测量表 record = new 小导管卡箍间距测量表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _xiaodaoguankagujianjuceliangbiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _xiaodaoguankagujianjuceliangbiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _xiaodaoguankagujianjuceliangbiaoRepository.Get(item);
                                    await _xiaodaoguankagujianjuceliangbiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "未按要求施加力矩及未打保险防松记录表":
                        {
                            var localIdList = workStep.FailureAequiredLoosInsurance.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.FailureAequiredLoosInsurance)
                                {
                                    未按要求施加力矩及未打保险防松记录表 record = new 未按要求施加力矩及未打保险防松记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.ProcessorDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.FailureAequiredLoosInsurance)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<FailureAequiredLoosInsuranceDto>(query));
                                        未按要求施加力矩及未打保险防松记录表 record = new 未按要求施加力矩及未打保险防松记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.ProcessorDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        未按要求施加力矩及未打保险防松记录表 record = new 未按要求施加力矩及未打保险防松记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.ProcessorDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.Get(item);
                                    await _weianyaoqiushijialijujiweidabaoxianfangsongjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "分解重装记录表":
                        {
                            var localIdList = workStep.DisassemblyReassembly.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.DisassemblyReassembly)
                                {
                                    分解重装记录表 record = new 分解重装记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _fenjiechongzhuangjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.DisassemblyReassembly)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<DisassemblyReassemblyDto>(query));
                                        分解重装记录表 record = new 分解重装记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _fenjiechongzhuangjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        分解重装记录表 record = new 分解重装记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _fenjiechongzhuangjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _fenjiechongzhuangjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _fenjiechongzhuangjilubiaoRepository.Get(item);
                                    await _fenjiechongzhuangjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "配合七零三绝热记录表":
                        {
                            var localIdList = workStep.Insulation703.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Insulation703)
                                {
                                    配合七零三绝热记录表 record = new 配合七零三绝热记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ParentProductName);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _peiheqilingsanjuerejilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Insulation703)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<Insulation703Dto>(query));
                                        配合七零三绝热记录表 record = new 配合七零三绝热记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ParentProductName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _peiheqilingsanjuerejilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        配合七零三绝热记录表 record = new 配合七零三绝热记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ParentProductName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _peiheqilingsanjuerejilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _peiheqilingsanjuerejilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _peiheqilingsanjuerejilubiaoRepository.Get(item);
                                    await _peiheqilingsanjuerejilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "绝热去除记录表":
                        {
                            var localIdList = workStep.AdiabaticRemoval.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.AdiabaticRemoval)
                                {
                                    绝热去除记录表 record = new 绝热去除记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _juerequchujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.AdiabaticRemoval)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<AdiabaticRemovalDto>(query));
                                        绝热去除记录表 record = new 绝热去除记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _juerequchujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        绝热去除记录表 record = new 绝热去除记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _juerequchujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _juerequchujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _juerequchujilubiaoRepository.Get(item);
                                    await _juerequchujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "连续拧紧环节力矩复校记录表":
                        {
                            var localIdList = workStep.CalibrationContinuousTorque.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CalibrationContinuousTorque)
                                {
                                    连续拧紧环节力矩复校记录表 record = new 连续拧紧环节力矩复校记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.ProcessorDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _lianxuningjinhuanjielijufujiaojilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CalibrationContinuousTorque)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CalibrationContinuousTorqueDto>(query));
                                        连续拧紧环节力矩复校记录表 record = new 连续拧紧环节力矩复校记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.ProcessorDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _lianxuningjinhuanjielijufujiaojilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        连续拧紧环节力矩复校记录表 record = new 连续拧紧环节力矩复校记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.SecondDrawingNum, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.DesignerDemand, item.ProcessorDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _lianxuningjinhuanjielijufujiaojilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _lianxuningjinhuanjielijufujiaojilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _lianxuningjinhuanjielijufujiaojilubiaoRepository.Get(item);
                                    await _lianxuningjinhuanjielijufujiaojilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "管路垫块安装情况记录表":
                        {
                            var localIdList = workStep.InstallationPipeCushion.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InstallationPipeCushion)
                                {
                                    管路垫块安装情况记录表 record = new 管路垫块安装情况记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _guanlidiankuaianzhuangqingkuangjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InstallationPipeCushion)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InstallationPipeCushionDto>(query));
                                        管路垫块安装情况记录表 record = new 管路垫块安装情况记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _guanlidiankuaianzhuangqingkuangjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        管路垫块安装情况记录表 record = new 管路垫块安装情况记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _guanlidiankuaianzhuangqingkuangjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _guanlidiankuaianzhuangqingkuangjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _guanlidiankuaianzhuangqingkuangjilubiaoRepository.Get(item);
                                    await _guanlidiankuaianzhuangqingkuangjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "箭体结构防水记录表":
                        {
                            var localIdList = workStep.ArrowStructureWaterproof.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ArrowStructureWaterproof)
                                {
                                    箭体结构防水记录表 record = new 箭体结构防水记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductName, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _jiantijiegoufangshuijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ArrowStructureWaterproof)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ArrowStructureWaterproofDto>(query));
                                        箭体结构防水记录表 record = new 箭体结构防水记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _jiantijiegoufangshuijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        箭体结构防水记录表 record = new 箭体结构防水记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _jiantijiegoufangshuijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _jiantijiegoufangshuijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _jiantijiegoufangshuijilubiaoRepository.Get(item);
                                    await _jiantijiegoufangshuijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "搭接线安装部位防水记录表":
                        {
                            var localIdList = workStep.WaterproofInstallationLapd.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.WaterproofInstallationLapd)
                                {
                                    搭接线安装部位防水记录表 record = new 搭接线安装部位防水记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _dajiexiananzhuangbuweifangshuijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.WaterproofInstallationLapd)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<WaterproofInstallationLapdDto>(query));
                                        搭接线安装部位防水记录表 record = new 搭接线安装部位防水记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _dajiexiananzhuangbuweifangshuijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        搭接线安装部位防水记录表 record = new 搭接线安装部位防水记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _dajiexiananzhuangbuweifangshuijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dajiexiananzhuangbuweifangshuijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dajiexiananzhuangbuweifangshuijilubiaoRepository.Get(item);
                                    await _dajiexiananzhuangbuweifangshuijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "箭体称重时多装少装产品记录表":
                        {
                            var localIdList = workStep.ArrowScalageProducts.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ArrowScalageProducts)
                                {
                                    箭体称重时多装少装产品记录表 record = new 箭体称重时多装少装产品记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                    await _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.InsertAsync(record);

                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ArrowScalageProducts)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ArrowScalageProductsDto>(query));
                                        箭体称重时多装少装产品记录表 record = new 箭体称重时多装少装产品记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                        record.Id = item.Id;
                                        await _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        箭体称重时多装少装产品记录表 record = new 箭体称重时多装少装产品记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.FirstConfirmResult);
                                        await _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.Get(item);
                                    await _jiantichengzhongshiduozhuangshaozhuangchanpinjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "箭体称重记录表":
                        {
                            var localIdList = workStep.ArrowWeight.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ArrowWeight)
                                {
                                    箭体称重记录表 record = new 箭体称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _jiantichengzhongjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ArrowWeight)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ArrowWeightDto>(query));
                                        箭体称重记录表 record = new 箭体称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _jiantichengzhongjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        箭体称重记录表 record = new 箭体称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ParentProductName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _jiantichengzhongjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _jiantichengzhongjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}

                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _jiantichengzhongjilubiaoRepository.Get(item);
                                    await _jiantichengzhongjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }
                            break;
                        }
                    case "总装零件称重记录表":
                        {
                            var localIdList = workStep.Assemnleweighing.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.Assemnleweighing)
                                {
                                    总装零件称重记录表 record = new 总装零件称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _zongzhuanglingjianchengzhongjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.Assemnleweighing)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<AssemnleweighingDto>(query));
                                        总装零件称重记录表 record = new 总装零件称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _zongzhuanglingjianchengzhongjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        总装零件称重记录表 record = new 总装零件称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _zongzhuanglingjianchengzhongjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _zongzhuanglingjianchengzhongjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _zongzhuanglingjianchengzhongjilubiaoRepository.Get(item);
                                    await _zongzhuanglingjianchengzhongjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "阀门安装状态确认表":
                        {
                            var localIdList = workStep.ConfirmationStatus.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ConfirmationStatus)
                                {
                                    阀门安装状态确认表 record = new 阀门安装状态确认表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    await _famenanzhuangzhuangtaiquerenbiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ConfirmationStatus)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ConfirmationStatusDto>(query));
                                        阀门安装状态确认表 record = new 阀门安装状态确认表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.Id = item.Id;
                                        await _famenanzhuangzhuangtaiquerenbiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        阀门安装状态确认表 record = new 阀门安装状态确认表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.FisrtDrawingNum, item.FirstDrawingName, item.ProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        await _famenanzhuangzhuangtaiquerenbiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _famenanzhuangzhuangtaiquerenbiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _famenanzhuangzhuangtaiquerenbiaoRepository.Get(item);
                                    await _famenanzhuangzhuangtaiquerenbiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "传感器变换器对应关系确认记录表":
                        {
                            var localIdList = workStep.CorrespondingRelationship.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CorrespondingRelationship)
                                {
                                    传感器变换器对应关系确认记录表 record = new 传感器变换器对应关系确认记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum, item.ParentProductName, item.SecondDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CorrespondingRelationship)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CorrespondingRelationshipDto>(query));
                                        传感器变换器对应关系确认记录表 record = new 传感器变换器对应关系确认记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum, item.ParentProductName, item.SecondDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        传感器变换器对应关系确认记录表 record = new 传感器变换器对应关系确认记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum, item.ParentProductName, item.SecondDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.Get(item);
                                    await _chuanganqibianhuanqiduiyingguanxiquerenjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "密封插头压接多媒体记录表":
                        {
                            var localIdList = workStep.CrimpingSealedPlug.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CrimpingSealedPlug)
                                {
                                    密封插头压接多媒体记录表 record = new 密封插头压接多媒体记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.Remarks);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _mifengchatouyajieduomeitijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CrimpingSealedPlug)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CrimpingSealedPlugDto>(query));
                                        密封插头压接多媒体记录表 record = new 密封插头压接多媒体记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.Remarks);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _mifengchatouyajieduomeitijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        密封插头压接多媒体记录表 record = new 密封插头压接多媒体记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ParentProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordMainopoint, item.Remarks);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _mifengchatouyajieduomeitijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _mifengchatouyajieduomeitijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _mifengchatouyajieduomeitijilubiaoRepository.Get(item);
                                    await _mifengchatouyajieduomeitijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "气瓶组充放气速率记录表":  //SecondMeasuredValues
                        {
                            var localIdList = workStep.CylinderGroup.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CylinderGroup)
                                {
                                    气瓶组充放气速率记录表 record = new 气瓶组充放气速率记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _qipingzuchongfangqisulvjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CylinderGroup)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CylinderGroupDto>(query));
                                        气瓶组充放气速率记录表 record = new 气瓶组充放气速率记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _qipingzuchongfangqisulvjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        气瓶组充放气速率记录表 record = new 气瓶组充放气速率记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _qipingzuchongfangqisulvjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _qipingzuchongfangqisulvjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}

                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _qipingzuchongfangqisulvjilubiaoRepository.Get(item);
                                    await _qipingzuchongfangqisulvjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }
                            break;
                        }
                    case "气瓶压力测试记录表":
                        {
                            var localIdList = workStep.CylinderPressureTest.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.CylinderPressureTest)
                                {
                                    气瓶压力测试记录表 record = new 气瓶压力测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    await _qipingyaliceshijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.CylinderPressureTest)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<CylinderPressureTestDto>(query));
                                        气瓶压力测试记录表 record = new 气瓶压力测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Id = item.Id;
                                        await _qipingyaliceshijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        气瓶压力测试记录表 record = new 气瓶压力测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        await _qipingyaliceshijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _qipingyaliceshijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _qipingyaliceshijilubiaoRepository.Get(item);
                                    await _qipingyaliceshijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "干燥剂检查记录表":
                        {
                            var localIdList = workStep.DesiccantInspection.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.DesiccantInspection)
                                {
                                    干燥剂检查记录表 record = new 干燥剂检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _ganzaojijianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.DesiccantInspection)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<DesiccantInspectionDto>(query));
                                        干燥剂检查记录表 record = new 干燥剂检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _ganzaojijianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        干燥剂检查记录表 record = new 干燥剂检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _ganzaojijianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _ganzaojijianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _ganzaojijianchajilubiaoRepository.Get(item);
                                    await _ganzaojijianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "低频压接实验测量记录表":
                        {
                            var localIdList = workStep.ExperimentalCrimping.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ExperimentalCrimping)
                                {
                                    低频压接实验测量记录表 record = new 低频压接实验测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed, item.RecordItem);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _dipinyajieshiyanceliangjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ExperimentalCrimping)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ExperimentalCrimpingDto>(query));
                                        低频压接实验测量记录表 record = new 低频压接实验测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed, item.RecordItem);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _dipinyajieshiyanceliangjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        低频压接实验测量记录表 record = new 低频压接实验测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed, item.RecordItem);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _dipinyajieshiyanceliangjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dipinyajieshiyanceliangjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dipinyajieshiyanceliangjilubiaoRepository.Get(item);
                                    await _dipinyajieshiyanceliangjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "飞行质量质心皮重及参数记录表":
                        {
                            var localIdList = workStep.FlightMassCentroidTareWeight.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.FlightMassCentroidTareWeight)
                                {
                                    飞行质量质心皮重及参数记录表 record = new 飞行质量质心皮重及参数记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.RecordItem);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    await _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.FlightMassCentroidTareWeight)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<FlightMassCentroidTareWeightDto>(query));
                                        飞行质量质心皮重及参数记录表 record = new 飞行质量质心皮重及参数记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Id = item.Id;
                                        await _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        飞行质量质心皮重及参数记录表 record = new 飞行质量质心皮重及参数记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.RecordItem);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        await _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.Get(item);
                                    await _feixingzhiliangzhixinpizhongjicanshujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "气封流量测试记录表":
                        {
                            var localIdList = workStep.GasSealFlowTest.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.GasSealFlowTest)
                                {
                                    气封流量测试记录表 record = new 气封流量测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.ThirdMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _qifengliuliangceshijilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.GasSealFlowTest)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<GasSealFlowTestDto>(query));
                                        气封流量测试记录表 record = new 气封流量测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.ThirdMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _qifengliuliangceshijilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        气封流量测试记录表 record = new 气封流量测试记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.ThirdMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _qifengliuliangceshijilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _qifengliuliangceshijilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _qifengliuliangceshijilubiaoRepository.Get(item);
                                    await _qifengliuliangceshijilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "总装耗材称重记录表":
                        {
                            var localIdList = workStep.GeneralWeighing.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.GeneralWeighing)
                                {
                                    总装耗材称重记录表 record = new 总装耗材称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _zongzhuanghaocaichengzhongjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.GeneralWeighing)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<GeneralWeighingDto>(query));
                                        总装耗材称重记录表 record = new 总装耗材称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _zongzhuanghaocaichengzhongjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        总装耗材称重记录表 record = new 总装耗材称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName, item.ToolUsed);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _zongzhuanghaocaichengzhongjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _zongzhuanghaocaichengzhongjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _zongzhuanghaocaichengzhongjilubiaoRepository.Get(item);
                                    await _zongzhuanghaocaichengzhongjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "高频压接点电阻及抗电强度检查记录表":
                        {
                            var localIdList = workStep.HighFrequencyVoltage.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.HighFrequencyVoltage)
                                {
                                    高频压接点电阻及抗电强度检查记录表 record = new 高频压接点电阻及抗电强度检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.HighFrequencyVoltage)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<HighFrequencyVoltageDto>(query));
                                        高频压接点电阻及抗电强度检查记录表 record = new 高频压接点电阻及抗电强度检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        高频压接点电阻及抗电强度检查记录表 record = new 高频压接点电阻及抗电强度检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.SecondToolUsed, item.ThirdToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.RecordStatus, item.RecordMainopoint);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.Get(item);
                                    await _gaopinyajiediandianzujikangdianqiangdujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "产品安装数量记录表":
                        {
                            var localIdList = workStep.InstallationQuantity.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InstallationQuantity)
                                {
                                    产品安装数量记录表 record = new 产品安装数量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _chanpinanzhuangshuliangjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InstallationQuantity)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InstallationQuantityDto>(query));
                                        产品安装数量记录表 record = new 产品安装数量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _chanpinanzhuangshuliangjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        产品安装数量记录表 record = new 产品安装数量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _chanpinanzhuangshuliangjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _chanpinanzhuangshuliangjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _chanpinanzhuangshuliangjilubiaoRepository.Get(item);
                                    await _chanpinanzhuangshuliangjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "接口检查记录表":
                        {
                            var localIdList = workStep.InterfaceCheck.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.InterfaceCheck)
                                {
                                    接口检查记录表 record = new 接口检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _jiekoujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.InterfaceCheck)
                                {

                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<InterfaceCheckDto>(query));
                                        接口检查记录表 record = new 接口检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _jiekoujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        接口检查记录表 record = new 接口检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _jiekoujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _jiekoujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _jiekoujianchajilubiaoRepository.Get(item);
                                    await _jiekoujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "岗位分工表":
                        {
                            var localIdList = workStep.JobDivision.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.JobDivision)
                                {
                                    岗位分工表 record = new 岗位分工表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _gangweifengongbiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.JobDivision)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<JobDivisionDto>(query));
                                        岗位分工表 record = new 岗位分工表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _gangweifengongbiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        岗位分工表 record = new 岗位分工表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _gangweifengongbiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _gangweifengongbiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _gangweifengongbiaoRepository.Get(item);
                                    await _gangweifengongbiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "随大部段交付产品明细表":
                        {
                            var localIdList = workStep.LargePartsDelivery.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LargePartsDelivery)
                                {
                                    随大部段交付产品明细表 record = new 随大部段交付产品明细表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    await _suidabuduanjiaofuchanpinmingxibiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LargePartsDelivery)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LargePartsDeliveryDto>(query));
                                        随大部段交付产品明细表 record = new 随大部段交付产品明细表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.Id = item.Id;
                                        await _suidabuduanjiaofuchanpinmingxibiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        随大部段交付产品明细表 record = new 随大部段交付产品明细表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        await _suidabuduanjiaofuchanpinmingxibiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _suidabuduanjiaofuchanpinmingxibiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _suidabuduanjiaofuchanpinmingxibiaoRepository.Get(item);
                                    await _suidabuduanjiaofuchanpinmingxibiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "飞行质量质心设备调平数据记录表":
                        {
                            var localIdList = workStep.LevelingDataFlight.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LevelingDataFlight)
                                {
                                    飞行质量质心设备调平数据记录表 record = new 飞行质量质心设备调平数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    await _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LevelingDataFlight)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LevelingDataFlightDto>(query));
                                        飞行质量质心设备调平数据记录表 record = new 飞行质量质心设备调平数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Id = item.Id;
                                        await _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        飞行质量质心设备调平数据记录表 record = new 飞行质量质心设备调平数据记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        await _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.Get(item);
                                    await _feixingzhiliangzhixinshebeitiaopingshujujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "液位传感器尺寸协调记录表":
                        {
                            var localIdList = workStep.LiquidLevelSensor.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LiquidLevelSensor)
                                {
                                    液位传感器尺寸协调记录表 record = new 液位传感器尺寸协调记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _yeweichuanganqichicunxietiaojilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LiquidLevelSensor)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LiquidLevelSensorDto>(query));
                                        液位传感器尺寸协调记录表 record = new 液位传感器尺寸协调记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _yeweichuanganqichicunxietiaojilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        液位传感器尺寸协调记录表 record = new 液位传感器尺寸协调记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _yeweichuanganqichicunxietiaojilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _yeweichuanganqichicunxietiaojilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _yeweichuanganqichicunxietiaojilubiaoRepository.Get(item);
                                    await _yeweichuanganqichicunxietiaojilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "产品安装确认表":
                        {
                            var localIdList = workStep.ProductInstallationConfirmation.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ProductInstallationConfirmation)
                                {
                                    产品安装确认表 record = new 产品安装确认表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    await _chanpinanzhuangquerenbiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ProductInstallationConfirmation)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ProductInstallationConfirmationDto>(query));
                                        产品安装确认表 record = new 产品安装确认表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.Id = item.Id;
                                        await _chanpinanzhuangquerenbiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        产品安装确认表 record = new 产品安装确认表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.ProcessorDemand, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        await _chanpinanzhuangquerenbiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _chanpinanzhuangquerenbiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _chanpinanzhuangquerenbiaoRepository.Get(item);
                                    await _chanpinanzhuangquerenbiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "通用保护件检查记录表":
                        {
                            var localIdList = workStep.ProtectiveParts.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ProtectiveParts)
                                {
                                    通用保护件检查记录表 record = new 通用保护件检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _tongyongbaohujianjianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ProtectiveParts)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ProtectivePartsDto>(query));
                                        通用保护件检查记录表 record = new 通用保护件检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _tongyongbaohujianjianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用保护件检查记录表 record = new 通用保护件检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordStatus, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult, item.MeasuredActual);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _tongyongbaohujianjianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _tongyongbaohujianjianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _tongyongbaohujianjianchajilubiaoRepository.Get(item);
                                    await _tongyongbaohujianjianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "象限标识检查记录表":
                        {
                            var localIdList = workStep.QuadrantCheck.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.QuadrantCheck)
                                {
                                    象限标识检查记录表 record = new 象限标识检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                    await _xiangxianbiaoshijianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.QuadrantCheck)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<QuadrantCheckDto>(query));
                                        象限标识检查记录表 record = new 象限标识检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        record.Id = item.Id;
                                        await _xiangxianbiaoshijianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        象限标识检查记录表 record = new 象限标识检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation, item.RecordRequire, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.FirstConfirmResult);
                                        await _xiangxianbiaoshijianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _xiangxianbiaoshijianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _xiangxianbiaoshijianchajilubiaoRepository.Get(item);
                                    await _xiangxianbiaoshijianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "通用接收检查记录表":
                        {
                            var localIdList = workStep.ReceivingInspectionRecord.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ReceivingInspectionRecord)
                                {
                                    通用接收检查记录表 record = new 通用接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                    record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _tongyongjieshoujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ReceivingInspectionRecord)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ReceivingInspectionRecordDto>(query));
                                        通用接收检查记录表 record = new 通用接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _tongyongjieshoujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        通用接收检查记录表 record = new 通用接收检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.MeasuredActual);
                                        record.MultiMedia = record.SetMultiMedia(new MultiMediaEntity(), item.PhotoNo);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _tongyongjieshoujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _tongyongjieshoujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _tongyongjieshoujianchajilubiaoRepository.Get(item);
                                    await _tongyongjieshoujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "系统保压记录表":
                        {
                            var localIdList = workStep.SystemPressureMaintaining.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.SystemPressureMaintaining)
                                {
                                    系统保压记录表 record = new 系统保压记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.DesignerDemand, item.RecordRequire);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    await _xitongbaoyajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.SystemPressureMaintaining)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<SystemPressureMaintainingDto>(query));
                                        系统保压记录表 record = new 系统保压记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.DesignerDemand, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.Id = item.Id;
                                        await _xitongbaoyajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        系统保压记录表 record = new 系统保压记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FirstDrawingName, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordStatus, item.DesignerDemand, item.RecordRequire);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        await _xitongbaoyajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _xitongbaoyajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _xitongbaoyajilubiaoRepository.Get(item);
                                    await _xitongbaoyajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "电磁阀尾罩检查表":  //RecordRequire
                        {
                            var localIdList = workStep.TailCoverSolenoid.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.TailCoverSolenoid)
                                {
                                    电磁阀尾罩检查表 record = new 电磁阀尾罩检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordLocation, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _diancifaweizhaojianchabiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.TailCoverSolenoid)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<TailCoverSolenoidDto>(query));
                                        电磁阀尾罩检查表 record = new 电磁阀尾罩检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordLocation, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _diancifaweizhaojianchabiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        电磁阀尾罩检查表 record = new 电磁阀尾罩检查表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordLocation, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstConfirmResult);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _diancifaweizhaojianchabiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _diancifaweizhaojianchabiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _diancifaweizhaojianchabiaoRepository.Get(item);
                                    await _diancifaweizhaojianchabiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "高频压接点抗拉强度检查记录表":
                        {
                            var localIdList = workStep.TensileStrengthHigh.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.TensileStrengthHigh)
                                {
                                    高频压接点抗拉强度检查记录表 record = new 高频压接点抗拉强度检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.TensileStrengthHigh)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<TensileStrengthHighDto>(query));
                                        高频压接点抗拉强度检查记录表 record = new 高频压接点抗拉强度检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        高频压接点抗拉强度检查记录表 record = new 高频压接点抗拉强度检查记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.Get(item);
                                    await _gaopinyajiediankanglaqiangdujianchajilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "横向质心测量记录表":
                        {
                            var localIdList = workStep.TransverseCentroid.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.TransverseCentroid)
                                {
                                    横向质心测量记录表 record = new 横向质心测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                    await _hengxiangzhixinceliangjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.TransverseCentroid)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<TransverseCentroidDto>(query));
                                        横向质心测量记录表 record = new 横向质心测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        record.Id = item.Id;
                                        await _hengxiangzhixinceliangjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        横向质心测量记录表 record = new 横向质心测量记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordLocation);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues, item.ThirdMeasuredValues, item.FourthMeasuredValues);
                                        await _hengxiangzhixinceliangjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _hengxiangzhixinceliangjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _hengxiangzhixinceliangjilubiaoRepository.Get(item);
                                    await _hengxiangzhixinceliangjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }

                            }
                            break;
                        }
                    case "阀门测试记录表一":
                        {
                            var localIdList = workStep.ValveTest.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ValveTest)
                                {
                                    阀门测试记录表一 record = new 阀门测试记录表一(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _famenceshijilubiaoyiRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ValveTest)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ValveTestDto>(query));
                                        阀门测试记录表一 record = new 阀门测试记录表一(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _famenceshijilubiaoyiRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3); 
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        阀门测试记录表一 record = new 阀门测试记录表一(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _famenceshijilubiaoyiRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _famenceshijilubiaoyiRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _famenceshijilubiaoyiRepository.Get(item);
                                    await _famenceshijilubiaoyiRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "阀门测试记录表二":
                        {
                            var localIdList = workStep.ValveTestSec.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ValveTestSec)
                                {
                                    阀门测试记录表二 record = new 阀门测试记录表二(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _famenceshijilubiaoerRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ValveTestSec)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ValveTestSecDto>(query));
                                        阀门测试记录表二 record = new 阀门测试记录表二(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _famenceshijilubiaoerRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        阀门测试记录表二 record = new 阀门测试记录表二(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum, item.FirstDrawingName, item.RecordElement);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.RecordRequire, item.RecordStatus, item.Remarks);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues, item.SecondMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _famenceshijilubiaoerRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _famenceshijilubiaoerRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _famenceshijilubiaoerRepository.Get(item);
                                    await _famenceshijilubiaoerRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                    case "阀门使用次数记录表":
                        {
                            var localIdList = workStep.ValveUsageTimes.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.ValveUsageTimes)
                                {
                                    阀门使用次数记录表 record = new 阀门使用次数记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                    record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.RecordStatus);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _famenshiyongceshujilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.ValveUsageTimes)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<ValveUsageTimesDto>(query));
                                        阀门使用次数记录表 record = new 阀门使用次数记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _famenshiyongceshujilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        阀门使用次数记录表 record = new 阀门使用次数记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.FisrtDrawingNum, item.ProductNum);
                                        record.RecordRequirements = record.SetRecordRequirements(new RecordRequirementsEntity(), item.DesignerDemand, item.RecordStatus);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _famenshiyongceshujilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _famenshiyongceshujilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}
                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _famenshiyongceshujilubiaoRepository.Get(item);
                                    await _famenshiyongceshujilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                                // _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "更新" + tableName);
                            }
                            break;
                        }
                    case "大部段称重记录表":
                        {
                            var localIdList = workStep.LargeSectionWeight.Select(d => d.Id);
                            //更新
                            updateArr = dataIdList.Intersect(localIdList).ToArray();
                            //删除
                            deleteArr = dataIdList.Except(localIdList).ToArray();
                            //添加
                            addArr = localIdList.Except(dataIdList).ToArray();
                            if (!tableList.Contains(tableName))
                            {
                                foreach (var item in workStep.LargeSectionWeight)
                                {
                                    大部段称重记录表 record = new 大部段称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.RecordElement);
                                    record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                    record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                    record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                    await _dabuduanchengzhongjilubiaoRepository.InsertAsync(record);
                                }
                                _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.动态表新增, historyName + "插入" + tableName);
                            }
                            else
                            {
                                foreach (var item in workStep.LargeSectionWeight)
                                {
                                    if (updateArr.Contains(item.Id))
                                    {
                                        var query = table.Where(d => d.FormName == tableName).FirstOrDefault(d => d.Id == item.Id);
                                        var data = (ObjectMapper.Map<LargeSectionWeightDto>(query));
                                        大部段称重记录表 record = new 大部段称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.RecordElement);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        record.Id = item.Id;
                                        await _dabuduanchengzhongjilubiaoRepository.UpdateAsync(record);
                                        var updateString = GetOperationHistoryDesc(item, data, tableName, 3);
                                        if (updateString != "") { _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.编辑表格内容, historyName + "(" + tableName + ")操作:" + updateString); }
                                    }
                                    if (addArr.Contains(item.Id))
                                    {
                                        大部段称重记录表 record = new 大部段称重记录表(item.Sort, workStep.Id, workStep.ProcessesEntityId, item.Sort, item.ToolUsed, item.RecordElement);
                                        record.MeasuredResult = record.SetMeasuredResult(new MeasuredResultEntity(), item.FirstMeasuredValues);
                                        record.Environment = record.SetEnvironment(new EnvironmentEntity(), item.Temperature, item.Humidity);
                                        record.InspectionSignature = record.SetInspectionSignature(new InspectionSignatureEntity());
                                        await _dabuduanchengzhongjilubiaoRepository.InsertAsync(record);
                                        _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格添加行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 1));
                                    }
                                    //if (deleteArr.Contains(item.Id))
                                    //{
                                    //    await _dabuduanchengzhongjilubiaoRepository.DeleteAsync(item.Id);
                                    //    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(item, null, tableName, 2));
                                    //}

                                }
                                foreach (var item in deleteArr)
                                {
                                    var deleteItem = _dabuduanchengzhongjilubiaoRepository.Get(item);
                                    await _dabuduanchengzhongjilubiaoRepository.DeleteAsync(deleteItem);
                                    _iOperationHistoryAppService.InsertOperationLogNew(mocId, OperationHistory.BusinessTypes.Bop变更管理, OperationHistory.OperationTypes.表格删除行, historyName + "(" + tableName + ")操作:" + GetOperationHistoryDesc(deleteItem, null, tableName, 2));
                                }
                            }
                            break;
                        }
                }
                resultMessage.code = 0;
                return resultMessage;
            }
            catch (Exception ex)
            {
                resultMessage.code = 1;
                resultMessage.Message = "处理数据出现错误！" + ex.Message;
                return resultMessage;
                //throw new UserFriendlyException("处理数据出现错误！" + ex.Message);
            }


        }

        /// <summary>
        ///  获取比较后 字段变化描述
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="t">传入的单行数据</param>
        /// <param name="v"></param>
        /// <param name="tableName"></param>
        /// <param name="type">1 新增 2 删除 3 修改</param>
        /// <param name="description"></param>
        private string GetOperationHistoryDesc(object t, object v, string tableName, int type)
        {
            Common.TableMapConfig tableMapConfig = new Common.TableMapConfig();
            Dictionary<string, FiledNodeMap> tableMap = tableMapConfig.InitFiledNodeMap();
            System.Reflection.PropertyInfo[] mPi = t.GetType().GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
            Type tType = t.GetType();
            string description = "";
            string data_name = "";      //差别字段名
            string datavalue_old = "";  //老字段值
            string datavalue_new = "";  //新字段值
            var valueList = tableMap[tableName].filedValue;
            var keyList = tableMap[tableName].filedKey;
            switch (type)
            {
                case 1:
                    {
                        description = "【新增表格内容】:";
                        for (int i = 0; i < valueList.Count; i++)
                        {
                            string valueProName = char.ToUpper(valueList[i][0]) + valueList[i].Substring(1);
                            PropertyInfo _findedPropertyInfo = tType.GetProperty(valueProName);
                            if (_findedPropertyInfo != null)
                            {
                                var tempCheck = tType.GetProperty(valueProName).GetValue(t);
                                if (tempCheck != null)
                                {
                                    if (tType.GetProperty(valueProName).GetValue(t).ToString() != "")
                                    {
                                        var get_new = tType.GetProperty(valueProName).GetValue(t, null).ToString();
                                        description = description + keyList[i] + ":" + get_new + ",";
                                    }
                                }
                               
                            }
                        }
                    }
                    break;
                case 2:
                    {
                        description = "【删除表格内容】:";
                      
                        for (int i = 0; i < valueList.Count; i++)
                        {
                            string valueProName = char.ToUpper(valueList[i][0]) + valueList[i].Substring(1);
                            PropertyInfo _findedPropertyInfo = tType.GetProperty(valueProName);
                            if (_findedPropertyInfo != null)
                            {
                                var tempCheck = tType.GetProperty(valueProName).GetValue(t);
                                if (tempCheck != null)
                                {
                                    if (tType.GetProperty(valueProName).GetValue(t).ToString() != "")
                                    {
                                        var get_new = tType.GetProperty(valueProName).GetValue(t, null).ToString();
                                        description = description + keyList[i] + ":" + get_new + ",";
                                    }
                                    else
                                    {
                                        description = description + keyList[i] + ": ,";
                                    }
                                }
                                else
                                {
                                    description = description + keyList[i] + ": ,";
                                }
                            }
                        }
                    }
                    break;
                case 3:
                    {
                        description = "【修改表格内容】:";
                       
                        Type vType = v.GetType();
                        datavalue_old = "原数据为:";
                        datavalue_new = "修改数据为:";
                        bool checkChage = false;
                        for (int i = 0; i < valueList.Count; i++)
                        {
                         
                            string get_new = "";
                            string get_old = "";
                            string valueProName = char.ToUpper(valueList[i][0]) + valueList[i].Substring(1);
                            PropertyInfo _tfindedPropertyInfo = tType.GetProperty(valueProName);

                            PropertyInfo _vfindedPropertyInfo = vType.GetProperty(valueProName);
                            if (_tfindedPropertyInfo != null)
                            {
                                var tempCheck = tType.GetProperty(valueProName).GetValue(t);
                                if (tempCheck != null)
                                {
                                    if (tType.GetProperty(valueProName).GetValue(t).ToString() != "")
                                    {
                                        get_new = tType.GetProperty(valueProName).GetValue(t, null).ToString();
                                    }
                                }
                            }
                            if (_vfindedPropertyInfo != null)
                            {
                                var tempCheck = vType.GetProperty(valueProName).GetValue(v);
                                if (tempCheck != null)
                                {
                                    if (vType.GetProperty(valueProName).GetValue(v).ToString() != "")
                                    {
                                        get_old = vType.GetProperty(valueProName).GetValue(v, null).ToString();
                                    }
                                }
                            }
                            if (get_old != get_new)
                            {
                                checkChage = true;
                                datavalue_old = datavalue_old + keyList[i] + ":" + get_old + ",";
                                datavalue_new = datavalue_new + keyList[i] + ":" + get_new + ",";
                            }
                        }
                        if (checkChage)
                        {
                            description = description + datavalue_old + datavalue_new;
                        }
                        else
                        {
                            description = "";
                        }
                    }
                    break;
                default:
                    break;
            }
            return description;
        }
    }
}
